summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-04-07 10:43:30 +0200
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commitf0ee1e2be579904495b2a78d56c314960392e94f (patch)
treee3157bb5d24764dc49b20f8f7c259b9185208e9c /addons/web/static/src/js/views/basic
parent0cb500594627c4cbe94d4e8c86d69f74ca031f35 (diff)
[FIX] web: add session user_context in the evalcontext
When evaluating a domain, we need to add the user context, so domains can use a key such as uid.
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index 7badafa43c5..e5e7da7867b 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1915,6 +1915,10 @@ var BasicModel = AbstractModel.extend({
* Returns the evaluation context that should be used when evaluating the
* context/domain associated to a given element from the localData.
*
+ * It is actually quite subtle. We need to add some magic keys: active_id
+ * and active_ids. Also, the session user context is added in the mix to be
+ * sure. This allows some domains to use the uid key for example
+ *
* @param {Object} element - an element from the localData
* @returns {Object}
*/
@@ -1932,7 +1936,7 @@ var BasicModel = AbstractModel.extend({
}
_.extend(evalContext, {parent: parent.data});
}
- return evalContext;
+ return _.extend({}, session.user_context, evalContext);
},
/**
* Returns the list of field names of the given element according to its