Replace getattr by hasattr in report

(grafted from 1a0574d67704d7acbd7c224d906a4be12aaf3423)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-06-09 13:01:23 +02:00
parent a86bc71a32
commit 35291a25e2
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ this repository contains the full copyright notices and license terms. -->
<py:def function="TaxCategory(tax)">
<cbc:ID py:if="tax.unece_category_code">${tax.unece_category_code}</cbc:ID>
<cbc:Percent py:if="tax.type == 'percentage'">${format((tax.rate * 100).normalize(), 'f')}</cbc:Percent>
<cbc:TaxExemptionReasonCode py:if="getattr(tax, 'vatex_code', None)">${tax.vatex_code}</cbc:TaxExemptionReasonCode>
<cbc:TaxExemptionReasonCode py:if="hasattr(tax, 'vatex_code') and tax.vatex_code">${tax.vatex_code}</cbc:TaxExemptionReasonCode>
<cbc:TaxExemptionReason py:if="tax.legal_notice">${tax.legal_notice}</cbc:TaxExemptionReason>
<cac:TaxScheme py:if="tax.unece_code">
<cbc:ID>${tax.unece_code}</cbc:ID>