Advertisement
rht_odoo

[QW][4721270]remove_best_before_date_and_change_name_report_lot_label

Apr 15th, 2025 (edited)
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.79 KB | None | 0 0
  1. <data>
  2.     <!--
  3.    Done by RHT on the 15/04/2025
  4.    Need : remove the best before date from the lot and change the product name to the variant name
  5.    Task : https://www.odoo.com/odoo/project/5686/tasks/4721270
  6.    Pastebin : https://pastebin.com/zbUaNKUv
  7.    -->
  8.    
  9.     <!-- Remove the Best Before (B.b.) date -->
  10.     <xpath expr="//div[@t-if='o.use_date']" position="replace"/>
  11.  
  12.     <!-- Replace product name with product variant name -->
  13.     <xpath expr="//div[@t-field='o.product_id.name']" position="replace">
  14.         <t t-set="product_name" t-value="o.product_id.display_name.replace(o.product_id.default_code, '').replace('[','').replace(']','').strip()"/>
  15.         <div class="o_label_4x12" t-out="product_name" t-att-style="'width:22mm' if final_barcode else ''"/>
  16.     </xpath>
  17. </data>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement