changeset df00526a82b2 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=df00526a82b2
description:
        Allow to execute reports without records

        issue10409
        review355391002
diffstat:

 trytond/report/report.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r f9f1ecc399f7 -r df00526a82b2 trytond/report/report.py
--- a/trytond/report/report.py  Thu Sep 02 23:14:56 2021 +0200
+++ b/trytond/report/report.py  Thu Sep 02 23:19:36 2021 +0200
@@ -178,7 +178,10 @@
         if model:
             records = cls._get_records(ids, model, data)
 
-        if action_report.single:
+        if not records:
+            groups = [[]]
+            headers = [{}]
+        elif action_report.single:
             groups = [[r] for r in records]
             headers = [dict(cls.header_key(r)) for r in records]
         else:

Reply via email to