details:   https://code.tryton.org/tryton/commit/7a05844a9aff
branch:    7.8
user:      Cédric Krier <[email protected]>
date:      Tue Jun 09 13:01:23 2026 +0200
description:
        Replace getattr by hasattr in report
        (grafted from 1a0574d67704d7acbd7c224d906a4be12aaf3423)
diffstat:

 modules/account/general_ledger.fodt                    |  2 +-
 modules/stock_shipment_customs/commercial_invoice.fodt |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r e033d154c7c0 -r 7a05844a9aff modules/account/general_ledger.fodt
--- a/modules/account/general_ledger.fodt       Mon Jun 08 23:44:10 2026 +0200
+++ b/modules/account/general_ledger.fodt       Tue Jun 09 13:01:23 2026 +0200
@@ -913,7 +913,7 @@
       <text:p text:style-name="Table_20_Contents"><text:placeholder 
text:placeholder-type="text">&lt;line.description or 
&apos;&apos;&gt;</text:placeholder></text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Lines.G6" office:value-type="string">
-      <text:p text:style-name="Table_20_Contents"><text:placeholder 
text:placeholder-type="text">&lt;getattr(line.origin, &apos;rec_name&apos;, 
&apos;&apos;)&gt;</text:placeholder></text:p>
+      <text:p text:style-name="Table_20_Contents"><text:placeholder 
text:placeholder-type="text">&lt;line.origin and line.origin.rec_name or 
&apos;&apos;&gt;</text:placeholder></text:p>
      </table:table-cell>
     </table:table-row>
     <text:soft-page-break/>
diff -r e033d154c7c0 -r 7a05844a9aff 
modules/stock_shipment_customs/commercial_invoice.fodt
--- a/modules/stock_shipment_customs/commercial_invoice.fodt    Mon Jun 08 
23:44:10 2026 +0200
+++ b/modules/stock_shipment_customs/commercial_invoice.fodt    Tue Jun 09 
13:01:23 2026 +0200
@@ -710,7 +710,7 @@
     <text:p text:style-name="Text_20_body">Date: <text:placeholder 
text:placeholder-type="text">&lt;format_date(shipment.effective_date or 
shipment.planned_date) if (shipment.effective_date or shipment.planned_date) 
else &apos;&apos;&gt;</text:placeholder></text:p>
     <text:p text:style-name="P54">Terms of Trade: <text:placeholder 
text:placeholder-type="text">&lt;shipment.incoterm.name if shipment.incoterm 
else &apos;&apos;&gt;</text:placeholder></text:p>
     <text:p text:style-name="P37">Reason for Export: <text:placeholder 
text:placeholder-type="text">&lt;get_reason(shipment)&gt;</text:placeholder></text:p>
-    <text:p text:style-name="P57">Carrier: <text:placeholder 
text:placeholder-type="text">&lt;shipment.carrier.rec_name if getattr(shipment, 
&apos;carrier&apos;, None) else &apos;&apos;&gt;</text:placeholder></text:p>
+    <text:p text:style-name="P57">Carrier: <text:placeholder 
text:placeholder-type="text">&lt;shipment.carrier.rec_name if hasattr(shipment, 
&apos;carrier&apos;) and shipment.carrier else 
&apos;&apos;&gt;</text:placeholder></text:p>
     <text:p text:style-name="P57">Shipping reference: <text:placeholder 
text:placeholder-type="text">&lt;shipment.shipping_reference&gt;</text:placeholder></text:p>
    </text:section>
    <text:section text:style-name="Sect2" text:name="Section4">

Reply via email to