Use principal with the same company as the product context
Closes #13470 (grafted from f352742b532db1df2413a86ad66064f64f760863) --HG-- branch : 7.0
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user