Use principal with the same company as the product context

Closes #13470
This commit is contained in:
Cédric Krier
2024-08-23 01:16:26 +02:00
parent 7d14ec5830
commit 44e98af02b
+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):