From 829342c73ee403f802ee152633745b90d0f85d6d 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 : 7.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 f8199c8ec4..65f495e8fb 100644 --- a/modules/company/ir.py +++ b/modules/company/ir.py @@ -34,7 +34,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: timezone = tz.ZoneInfo(company.timezone)