From 35291a25e2baa6d5e71c3c6b5b2d8a07b28ca807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 9 Jun 2026 13:01:23 +0200 Subject: [PATCH] Replace getattr by hasattr in report (grafted from 1a0574d67704d7acbd7c224d906a4be12aaf3423) --HG-- branch : 8.0 --- modules/account/general_ledger.fodt | 2 +- modules/edocument_ubl/template/2/base.xml | 2 +- .../template/16B-CII/CrossIndustryInvoice.xml | 2 +- modules/stock_shipment_customs/commercial_invoice.fodt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/account/general_ledger.fodt b/modules/account/general_ledger.fodt index 28f75b455a..8d4cd36328 100644 --- a/modules/account/general_ledger.fodt +++ b/modules/account/general_ledger.fodt @@ -913,7 +913,7 @@ <line.description or ''> - <getattr(line.origin, 'rec_name', '')> + <line.origin and line.origin.rec_name or ''> diff --git a/modules/edocument_ubl/template/2/base.xml b/modules/edocument_ubl/template/2/base.xml index 8363fb6768..b54961e6e6 100644 --- a/modules/edocument_ubl/template/2/base.xml +++ b/modules/edocument_ubl/template/2/base.xml @@ -84,7 +84,7 @@ this repository contains the full copyright notices and license terms. --> ${tax.unece_category_code} ${format((tax.rate * 100).normalize(), 'f')} - ${tax.vatex_code} + ${tax.vatex_code} ${tax.legal_notice} ${tax.unece_code} diff --git a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml index 0f84f4df05..25ba81b3f5 100644 --- a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml +++ b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml @@ -45,7 +45,7 @@ this repository contains the full copyright notices and license terms. --> ${amount * this.type_sign} ${tax.unece_code} - ${tax.vatex_code} + ${tax.vatex_code} ${tax.legal_notice} ${base * this.type_sign} ${tax.unece_category_code} diff --git a/modules/stock_shipment_customs/commercial_invoice.fodt b/modules/stock_shipment_customs/commercial_invoice.fodt index fbd39c476d..84f3a14719 100644 --- a/modules/stock_shipment_customs/commercial_invoice.fodt +++ b/modules/stock_shipment_customs/commercial_invoice.fodt @@ -710,7 +710,7 @@ Date: <format_date(shipment.effective_date or shipment.planned_date) if (shipment.effective_date or shipment.planned_date) else ''> Terms of Trade: <shipment.incoterm.name if shipment.incoterm else ''> Reason for Export: <get_reason(shipment)> - Carrier: <shipment.carrier.rec_name if getattr(shipment, 'carrier', None) else ''> + Carrier: <shipment.carrier.rec_name if hasattr(shipment, 'carrier') and shipment.carrier else ''> Shipping reference: <shipment.shipping_reference>