From 78a6017ae8a738dc2438bf4f4dda83b2f2e70a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 10 Apr 2024 11:25:11 +0200 Subject: [PATCH] Test if contextual company id is positive before using it Closes #13176 (grafted from fa023763f7b00cd4fbfa9e818bf25db9e259cfbd) --HG-- branch : 7.0 --- modules/account/party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account/party.py b/modules/account/party.py index 40bb0edec5..44ab730506 100644 --- a/modules/account/party.py +++ b/modules/account/party.py @@ -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