From c2e2cdb14848fd027a54855e1337fe7b1347cc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 Sep 2021 23:19:36 +0200 Subject: [PATCH] Allow to execute reports without records issue10409 review355391002 --- trytond/report/report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trytond/report/report.py b/trytond/report/report.py index 36c55a871d..194cc6535a 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -178,7 +178,10 @@ class Report(URLMixin, PoolBase): 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: