Mercurial > trytond
changeset 8148:947d458462af 6.0
Allow to execute reports without records
issue10409
review355391002
(grafted from df00526a82b28df676073255295a5cdfee060bc5)
| author | Cédric Krier <ced@b2ck.com> |
|---|---|
| date | Thu, 02 Sep 2021 23:19:36 +0200 |
| parents | 84b798c7abed |
| children | 5fe8afce571d |
| files | trytond/report/report.py |
| diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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:
