From b7c3766e0e779089bd0165ac41c058312fd8b698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 May 2024 18:55:04 +0200 Subject: [PATCH] Ensure there is a company id in the context before testing as positive Closes #13228 (grafted from b317427d7a7599e310332894ab7ddbb013220d82) --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 44ab730506..063b41fa0f 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 >= 0: + if company_id is not None and company_id >= 0: company = Company(company_id) return company.currency.id