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
@@ -45,7 +45,7 @@ this repository contains the full copyright notices and license terms. -->
<ram:ApplicableTradeTax>
<ram:CalculatedAmount py:if="amount" py:attrs="{'currencyID': this.invoice.currency.code}">${amount * this.type_sign}</ram:CalculatedAmount>
<ram:TypeCode py:if="tax.unece_code">${tax.unece_code}</ram:TypeCode>
<ram:ExemptionReasonCode py:if="getattr(tax, 'vatex_code', None)">${tax.vatex_code}</ram:ExemptionReasonCode>
<ram:ExemptionReasonCode py:if="hasattr(tax, 'vatex_code') and tax.vatex_code">${tax.vatex_code}</ram:ExemptionReasonCode>
<ram:ExemptionReason py:if="tax.legal_notice">${tax.legal_notice}</ram:ExemptionReason>
<ram:BasisAmount py:if="base">${base * this.type_sign}</ram:BasisAmount>
<ram:CategoryCode py:if="tax.unece_category_code">${tax.unece_category_code}</ram:CategoryCode>