From 3f082a04afcfa1cf11d9c996a59bf835fa6ea22d 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 (grafted from df00526a82b28df676073255295a5cdfee060bc5) --HG-- branch : 6.0 --- 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 95f0f5a23d..89d7fc6ce5 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -163,7 +163,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: