From fd2fb47028ff8491e3173491dd22b6ed0305102a Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 22 May 2019 10:52:04 +0000 Subject: [PATCH] [IMP] model.py: Don't erase 'allowed_company_id' on with_context with args --- odoo/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/models.py b/odoo/models.py index aabc365d03b..a2499c6a68d 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -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))