LaOsaCoop/laosa16#12 product_print_category_supermarket: uom price from volume or net_weight

This commit is contained in:
Luis 2025-07-15 14:14:25 +02:00
parent bf582e5081
commit 4600c0d840

View file

@ -18,17 +18,28 @@
t-options='{"widget": "float", "precision": 2}' t-options='{"widget": "float", "precision": 2}'
/> €</strong> /> €</strong>
</div> </div>
<t t-if="product.packaging_ids and product.packaging_ids[0].qty"> <t t-if="product.volume or product.net_weight">
<div <div
style="vertical-align: bottom; position: absolute; bottom: 3mm; left: 3mm; style="vertical-align: bottom; position: absolute; bottom: 3mm; left: 3mm;
font-size: 0.8em; text-align: left;"> font-size: 0.8em; text-align: left;">
<t t-set="unit_price" <t t-if="product.volume">
t-value="round(product.list_price / product.packaging_ids[0].qty, 1)" /> <t
<strong> t-set="price_uom"
<t t-out="unit_price" t-options='{"widget": "float", "precision": 2}' /> t-value="round(product.list_price / (product.volume), 2)"
</strong> />
<strong>/</strong> <span
<strong t-field="product.packaging_ids[0].name" /> t-out="price_uom"
t-options='{"widget": "float", "precision": 2}' /> €/L.
</t>
<t t-if="product.net_weight">
<t
t-set="price_uom"
t-value="round(product.list_price / (product.net_weight), 2)"
/>
<span
t-out="price_uom"
t-options='{"widget": "float", "precision": 2}' /> €/Kg.
</t>
</div> </div>
</t> </t>
<div <div