changeset 3349aa07caab in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=3349aa07caab
description:
Use sync request on screen.get_selection
Otherwise the values may not be set when reading them
issue8975
review288791002
diffstat:
src/screen.js | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diffs (55 lines):
diff -r 5018284cf30a -r 3349aa07caab src/screen.js
--- a/src/screen.js Mon Dec 30 14:26:14 2019 +0100
+++ b/src/screen.js Thu Jan 09 15:22:43 2020 +0100
@@ -1619,11 +1619,6 @@
}
var fields = jQuery.extend({}, view_tree.fields);
- var set_selection = function(props) {
- return function(selection) {
- props.selection = selection;
- };
- };
for (var name in fields) {
var props = fields[name];
if ((props.type != 'selection') &&
@@ -1633,7 +1628,7 @@
if (props.selection instanceof Array) {
continue;
}
- this.get_selection(props).then(set_selection(props));
+ props.selection = this.get_selection(props);
}
if ('arch' in view_tree) {
@@ -1692,23 +1687,21 @@
return domain_parser;
},
get_selection: function(props) {
- var prm;
+ var selection;
var change_with = props.selection_change_with;
if (!jQuery.isEmptyObject(change_with)) {
var values = {};
change_with.forEach(function(p) {
values[p] = null;
});
- prm = this.model.execute(props.selection,
- [values]);
+ selection = this.model.execute(props.selection,
+ [values], undefined, false);
} else {
- prm = this.model.execute(props.selection,
- []);
+ selection = this.model.execute(props.selection,
+ [], undefined, false);
}
- return prm.then(function(selection) {
- return selection.sort(function(a, b) {
- return a[1].localeCompare(b[1]);
- });
+ return selection.sort(function(a, b) {
+ return a[1].localeCompare(b[1]);
});
},
search_prev: function(search_string) {