[FIX] ir_filters: filters not in the language of the user

the context must be passed to the get_filters function to take into account
the language of the user.

opw:630057
This commit is contained in:
Goffin Simon
2015-03-26 14:41:54 +01:00
parent 9333c88d71
commit b83f5a8ef9
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -1624,7 +1624,8 @@ instance.web.search.FavoriteMenu = instance.web.Widget.extend({
this.prepare_dropdown_menu([]);
return $.when();
}
return this.model.call('get_filters', [this.target_model, this.action_id])
return this.model.call('get_filters', [this.target_model, this.action_id],
{context: this.searchview.dataset.context})
.done(this.proxy('prepare_dropdown_menu'));
},
prepare_dropdown_menu: function (filters) {
+2 -2
View File
@@ -45,7 +45,7 @@ class ir_filters(osv.osv):
# only global ones
return [('action_id', '=', False)]
def get_filters(self, cr, uid, model, action_id=None):
def get_filters(self, cr, uid, model, action_id=None, context=None):
"""Obtain the list of filters available for the user on the given model.
:param action_id: optional ID of action to restrict filters to this action
@@ -62,7 +62,7 @@ class ir_filters(osv.osv):
filter_ids = self.search(cr, uid, action_domain +
[('model_id','=',model),('user_id','in',[uid, False])])
my_filters = self.read(cr, uid, filter_ids,
['name', 'is_default', 'domain', 'context', 'user_id'])
['name', 'is_default', 'domain', 'context', 'user_id'], context=context)
return my_filters
def _check_global_default(self, cr, uid, vals, matching_filters, context=None):