From ec5ebb20ec235c9f77ab218b1eca85acbd050218 Mon Sep 17 00:00:00 2001 From: "luc.demeyer@noviat.com" Date: Thu, 7 Feb 2019 17:43:40 +0100 Subject: [PATCH 1/2] [10.0][FIX]pass declaration to xls template --- intrastat_product/report/intrastat_product_report_xls.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/intrastat_product/report/intrastat_product_report_xls.py b/intrastat_product/report/intrastat_product_report_xls.py index cd21afe..dcd3c9b 100644 --- a/intrastat_product/report/intrastat_product_report_xls.py +++ b/intrastat_product/report/intrastat_product_report_xls.py @@ -23,7 +23,7 @@ class IntrastatProductDeclarationXlsx(AbstractReportXlsx): self.env.cr, IR_TRANSLATION_NAME, 'report', lang, src) or src return val - def _get_template(self): + def _get_template(self, declaration): template = { 'product': { @@ -194,7 +194,7 @@ class IntrastatProductDeclarationXlsx(AbstractReportXlsx): }, } template.update( - self.env['intrastat.product.declaration']._xls_template()) + declaration._xls_template()) return template @@ -209,7 +209,7 @@ class IntrastatProductDeclarationXlsx(AbstractReportXlsx): return declaration def _get_ws_params(self, wb, data, declaration): - template = self._get_template() + template = self._get_template(declaration) if self.env.context.get('computation_lines'): wl = declaration._xls_computation_line_fields() report = 'computation' From 30fe79858015ea627368e8de0daf21ccbd38211e Mon Sep 17 00:00:00 2001 From: "luc.demeyer@noviat.com" Date: Fri, 8 Feb 2019 12:29:34 +0100 Subject: [PATCH 2/2] add type & reporting level to lines context --- intrastat_product/report/intrastat_product_report_xls.py | 2 +- intrastat_product/views/intrastat_product_declaration.xml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/intrastat_product/report/intrastat_product_report_xls.py b/intrastat_product/report/intrastat_product_report_xls.py index dcd3c9b..3c4911e 100644 --- a/intrastat_product/report/intrastat_product_report_xls.py +++ b/intrastat_product/report/intrastat_product_report_xls.py @@ -40,7 +40,7 @@ class IntrastatProductDeclarationXlsx(AbstractReportXlsx): 'product_origin_country': { 'header': { 'type': 'string', - 'value': self._('Country of Origin of the Product'), + 'value': self._('Product C/O'), }, 'line': { 'type': 'string', diff --git a/intrastat_product/views/intrastat_product_declaration.xml b/intrastat_product/views/intrastat_product_declaration.xml index 7050c79..c6a7fa9 100644 --- a/intrastat_product/views/intrastat_product_declaration.xml +++ b/intrastat_product/views/intrastat_product_declaration.xml @@ -54,7 +54,9 @@ context="{'computation_lines': 1}"/> - + @@ -63,7 +65,9 @@ context="{'declaration_lines': 1}"/> - +