Use principal with the same company as the product context

Closes #13470
(grafted from f352742b532db1df2413a86ad66064f64f760863)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2024-08-23 01:16:26 +02:00
parent c9a3b21433
commit cf9f496a0d
+4 -2
View File
@@ -16,8 +16,10 @@ class Template(metaclass=PoolMeta):
@property
def principal(self):
if self.principals:
return self.principals[0]
company_id = self._context.get('company')
for agent in self.principals:
if agent.company.id == company_id:
return agent
class Template_Agent(ModelSQL):