From 002e018ce23066897915571207bb6906a9c55c70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 18 Jul 2017 12:23:04 +0000
Subject: [PATCH] ods_style: do not export an empty sheet for empty report
 header

In `sheet_per_report_section` mode if the report do not have any fields,
we use to display an empty sheet. It was confusing and not useful.
---
 .../portal_skins/erp5_ods_style/report_view.oot               | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.oot b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.oot
index 3cb7f996bb..846c87b778 100644
--- a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.oot
+++ b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.oot
@@ -114,7 +114,9 @@
             </tal:block>
 
             <!-- include the report header as last page -->
-            <table:table tal:attributes="table:name python:unicode(form.getProperty('title'), 'utf8')" i18n:attributes="table:name">
+            <table:table tal:condition="python: [field for field in form.get_fields()
+                                                 if field.getRecursiveTemplateField().meta_type != 'ReportBox']"
+                         tal:attributes="table:name python:unicode(form.getProperty('title'), 'utf8')" i18n:attributes="table:name">
               <table:table-column
                     table:style-name='co2'
                     table:number-columns-repeated='100'
-- 
2.30.9