From b0335a27b080ddbb3bc249c224226cf5dc4066fa 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 --- 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