From f13a67943d48cd608462b32efced55135babe1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 16 Dec 2024 16:55:06 +0100 Subject: [PATCH] Test if contextual company id is positive before using it to get the timezone Closes #13702 (grafted from fc47e80f9d10faaca8d4704f5a0c5b6765f5d9aa) --HG-- branch : 6.0 --- modules/company/ir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/company/ir.py b/modules/company/ir.py index 2807fe7dbd..2dd6e101b3 100644 --- a/modules/company/ir.py +++ b/modules/company/ir.py @@ -39,7 +39,7 @@ class Date(metaclass=PoolMeta): pool = Pool() Company = pool.get('company.company') company_id = Transaction().context.get('company') - if timezone is None and company_id: + if timezone is None and company_id is not None and company_id >= 0: company = Company(company_id) if company.timezone and pytz: timezone = pytz.timezone(company.timezone)