From 9e6789f8c1bc97feda66cf6a6648cb7d14e2b28e 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 --- 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 f43b4a01a2..1a47ae9bea 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