From f0ee1e2be579904495b2a78d56c314960392e94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 7 Apr 2017 10:43:30 +0200 Subject: [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. --- addons/web/static/src/js/views/basic/basic_model.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') 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 -- cgit v1.2.3