From 5804ed100ec790a36c5ff30a217914950cd78098 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 28 Feb 2017 11:48:00 +0100 Subject: [IMP] web, *: compute contexts and domains from datapoint This commit tries to refactore the management of contexts and domains in the webclient. - Get rid of CompoundDomain: use standard array manipulation to join multiple domains or use the Domain class (to be improved) - Get rid of data.js build_domain and build_context methods - Link this.record to the data point from the basic model for all fields (not only relational fields) - Add a getContext and a getDomain function to the basic model data point (localData element) so that AbstractField implementations can use them thanks to their this.record element. - Remove the autocontext binding for field RPCs (see FieldManagerMixin) --- addons/web/static/src/js/fields/basic_fields.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 6b2cd4d6754..17e4e33f20e 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1298,9 +1298,9 @@ var FieldDomain = AbstractField.extend({ // ... then query the model to get the number of matched record if valid var self = this; return def.then(function () { - var context = {}; // FIXME ? return self.rpc(self.domainModel, "search_count") - .args([domain,context]) + .args([domain]) + .kwargs({context: self.record.getContext({fieldName: self.name})}) .exec() .then(function (data) { self._isValidForModel = true; -- cgit v1.2.3