[IMP] model.py: Don't erase 'allowed_company_id' on with_context with args

This commit is contained in:
Yannick Tivisse
2019-05-29 08:33:18 +00:00
parent 3233c70026
commit fd2fb47028
+2
View File
@@ -4838,6 +4838,8 @@ Fields:
The returned recordset has the same prefetch object as ``self``.
"""
if args and 'allowed_company_ids' not in args[0] and 'allowed_company_ids' in self._context:
args[0]['allowed_company_ids'] = self._context.get('allowed_company_ids')
context = dict(args[0] if args else self._context, **kwargs)
return self.with_env(self.env(context=context))