From b042c699dd74cafe9845cb157fa898c1b491d9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Wed, 27 Oct 2021 17:01:59 +0200 Subject: [PATCH] Test GL context values against None instead of using their presence issue10896 review385271002 (grafted from 1e8fd17cfc05205c24ec565f96b6fe14bf9bf39c) --HG-- branch : 6.0 --- account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/account.py b/account.py index a8e57abf54..dafada36cc 100644 --- a/account.py +++ b/account.py @@ -1724,10 +1724,10 @@ class _GeneralLedgerAccount(ActivePeriodMixin, ModelSQL, ModelView): Account = cls._get_account() period_ids, from_date, to_date = None, None, None - context_keys = Transaction().context.keys() - if context_keys & {'start_period', 'end_period'}: + context = Transaction().context + if context.get('start_period') or context.get('end_period'): period_ids = cls.get_period_ids(name) - elif context_keys & {'from_date', 'end_date'}: + elif context.get('from_date') or context.get('end_date'): from_date, to_date = cls.get_dates(name) else: if name.startswith('start_'):