Test if contextual company id is positive before using it

Closes #13176
This commit is contained in:
Cédric Krier
2024-04-10 11:25:11 +02:00
parent bf7f66afe6
commit b0335a27b0
+1 -1
View File
@@ -111,7 +111,7 @@ class Party(CompanyMultiValueMixin, metaclass=PoolMeta):
pool = Pool()
Company = pool.get('company.company')
company_id = Transaction().context.get('company')
if company_id:
if company_id >= 0:
company = Company(company_id)
return company.currency.id