changeset b815f9d87027 in modules/account:5.8
details: https://hg.tryton.org/modules/account?cmd=changeset&node=b815f9d87027
description:
        Test GL context values against None instead of using their presence

        issue10896
        review385271002
        (grafted from 1e8fd17cfc05205c24ec565f96b6fe14bf9bf39c)
diffstat:

 account.py |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (17 lines):

diff -r 457a43244a31 -r b815f9d87027 account.py
--- a/account.py        Tue Oct 12 11:29:34 2021 +0200
+++ b/account.py        Wed Oct 27 17:01:59 2021 +0200
@@ -1689,10 +1689,10 @@
         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_'):

Reply via email to