changeset 70b03d2d6e23 in sao:5.4 details: https://hg.tryton.org/sao?cmd=changeset;node=70b03d2d6e23 description: Use sync request on screen.get_selection
Otherwise the values may not be set when reading them issue8975 review288791002 (grafted from 3349aa07caab93e6ab20709deaf57220f2d1e2a9) diffstat: src/screen.js | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-) diffs (55 lines): diff -r a81279c184a8 -r 70b03d2d6e23 src/screen.js --- a/src/screen.js Sat Dec 28 17:55:47 2019 +0100 +++ b/src/screen.js Thu Jan 09 15:22:43 2020 +0100 @@ -1601,11 +1601,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') && @@ -1615,7 +1610,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) { @@ -1674,23 +1669,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) {