Call fields_view_get synchronously to always have the right domain parser

issue6887
review43661002
This commit is contained in:
Cédric Krier
2017-10-30 11:37:27 +01:00
parent 6ba8db35d1
commit 9c0729a227
2 changed files with 5 additions and 10 deletions
+2 -2
View File
@@ -24,7 +24,7 @@
}
return added;
},
execute: function(method, params, context) {
execute: function(method, params, context, async) {
if (context === undefined) {
context = {};
}
@@ -32,7 +32,7 @@
'method': 'model.' + this.name + '.' + method,
'params': params.concat(context)
};
return Sao.rpc(args, this.session);
return Sao.rpc(args, this.session, async);
},
find: function(condition, offset, limit, order, context) {
if (!offset) offset = 0;
+3 -8
View File
@@ -1295,14 +1295,9 @@
return this._domain_parser[view_id];
}
if (!(view_id in this.fields_view_tree)) {
// Fetch default view for the next time
this.model.execute('fields_view_get', [false, 'tree'],
this.context).then(function(view) {
this.fields_view_tree[view_id] = view;
domain_parser.update_fields(view.fields);
}.bind(this));
view_tree = {};
view_tree.fields = {};
view_tree = this.model.execute('fields_view_get', [false, 'tree'],
this.context, false);
this.fields_view_tree[view_id] = view_tree;
} else {
view_tree = this.fields_view_tree[view_id];
}