From f3d65707560f1ffd68fbf4e5db5f08f61ee2e2d0 Mon Sep 17 00:00:00 2001 From: Manuel Calero Date: Mon, 9 Mar 2020 14:12:48 +0100 Subject: [PATCH] [FIX] intrastat_product: Excel report --- .../report/intrastat_product_report_xls.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/intrastat_product/report/intrastat_product_report_xls.py b/intrastat_product/report/intrastat_product_report_xls.py index e333224..47136c6 100644 --- a/intrastat_product/report/intrastat_product_report_xls.py +++ b/intrastat_product/report/intrastat_product_report_xls.py @@ -1,13 +1,10 @@ # Copyright 2009-2018 Noviat +# Copyright 2020 Manuel Calero - Tecnativa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import logging - from odoo import models from odoo.tools.translate import translate, _ -_logger = logging.getLogger(__name__) - IR_TRANSLATION_NAME = 'intrastat.product.report' @@ -32,7 +29,7 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): }, 'line': { 'value': self._render( - "line.product_id and line.product_id.name"), + "line.product_id.name or ''"), }, 'width': 36, }, @@ -56,7 +53,7 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): 'line': { 'type': 'string', 'value': self._render( - "line.hs_code_id.local_code"), + "line.hs_code_id.local_code or ''"), }, 'width': 14, }, @@ -68,7 +65,7 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): 'line': { 'type': 'string', 'value': self._render( - "line.src_dest_country_id.name"), + "line.src_dest_country_id.name or ''"), }, 'width': 28, },