summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-03-04 11:14:14 +0100
committerXavier Morel <xmo@openerp.com>2013-03-04 11:14:14 +0100
commitd46c61d7844c8aa67cbcde26f5e8d8c5ead278fb (patch)
tree9aa710462717c00727a1a74bd390bedc341c8122 /addons/web/static/src
parent0e370076f736fbca2db3fbac50f8b0dc96fb1823 (diff)
[FIX] don't store user context properties into custom filter @context
This leads to any subsequent view overwriting the current user's lang or timezone with the one active when the filter was created, generating dismay and discontent (e.g. part of the user interface switching from spanish to english or english to german, depending on the respective settings of the current user and the filter creator — at time of filter creation). bzr revid: xmo@openerp.com-20130304101414-mm6ai1dkltd7ard5
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/search.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index 36f766407b7..975e9ef034b 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -1680,6 +1680,13 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
if (!_.isEmpty(results.group_by)) {
results.context.group_by = results.group_by;
}
+ // Don't save user_context keys in the custom filter, otherwise end
+ // up with e.g. wrong uid or lang stored *and used in subsequent
+ // reqs*
+ var ctx = results.context;
+ _(_.keys(instance.session.user_context)).each(function (key) {
+ delete ctx[key];
+ });
var filter = {
name: $name.val(),
user_id: private_filter ? instance.session.uid : false,