Skip to content
Snippets Groups Projects
Commit b39c8da2 authored by fw-bot's avatar fw-bot Committed by Martin Trigaux
Browse files

[FIX] base: call context_get with the right user


self.env.user returns the current user but browsed with the superuser:
- self.env.user == current user
- self.env.user.env.user == administrator

get_context uses self.env.user to retrieve the context of the user.
Before this patch, the name of the filters was translated in the
language of the administrator instead of the current user.

Closes odoo/odoo#40086

closes odoo/odoo#40142

Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
parent 3add8dd2
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ class IrFilters(models.Model):
# and filters for the action (action_id=action_id) or global (action_id=NULL)
action_domain = self._get_action_domain(action_id)
filters = self.search(action_domain + [('model_id', '=', model), ('user_id', 'in', [self._uid, False])])
user_context = self.env.user.context_get()
user_context = self.env['res.users'].context_get()
return filters.with_context(user_context).read(['name', 'is_default', 'domain', 'context', 'user_id', 'sort'])
@api.model
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment