changeset 947d458462af in trytond:6.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=947d458462af
description:
Allow to execute reports without records
issue10409
review355391002
(grafted from df00526a82b28df676073255295a5cdfee060bc5)
diffstat:
trytond/report/report.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r 84b798c7abed -r 947d458462af trytond/report/report.py
--- a/trytond/report/report.py Wed Sep 01 22:45:22 2021 +0200
+++ b/trytond/report/report.py Thu Sep 02 23:19:36 2021 +0200
@@ -163,7 +163,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: