AVecinal/avecinal#57 product_print_category_supermarket: fix shelf labels

This commit is contained in:
Luis 2025-01-31 19:02:31 +01:00
parent 66bcb65b28
commit aaeb9f31cd
3 changed files with 100 additions and 100 deletions

View file

@ -1,6 +1,6 @@
.pricetag_container{
height: 3.7cm;
width: 7.1cm;
height: 3.1cm;
width: 6.3cm;
border: 2px solid black;
text-align: left;
margin: 10;
@ -11,12 +11,13 @@
}
.product_name {
font-size: 1em;
font-size: 0.9em;
font-weight: bold;
position: absolute;
margin-top: 1mm;
margin-left: 1mm;
text-align: left;
overflow: hidden;
}
.product_code {
@ -28,9 +29,9 @@
}
.product_state {
font-size: 0.8em;
font-size: 0.7em;
position: absolute;
margin-top: 1.7cm;
margin-top: 1.2cm;
right: 0.3cm;
text-align: right;
}
@ -38,13 +39,13 @@
.product_labels {
vertical-align:bottom;
position: absolute;
margin-top: 2cm;
margin-top: 1.2cm;
margin-left: 0.1cm;
width: 35%;
img {
height: 1cm;
width: 1cm;
height: 0.9cm;
width: 0.9cm;
float: left;
padding: 0.5mm
}
@ -53,10 +54,10 @@
.product_member_price {
font-size: 1.1em;
position: absolute;
width: 50%;
width: 48%;
text-align: right;
margin-top: 2.2cm;
margin-left: 3cm;
margin-top: 1.7cm;
margin-left: 3.3cm;
padding-right: 0.2cm;
background-color: green;
color: white;
@ -67,8 +68,8 @@
position: absolute;
width: 50%;
text-align: left;
margin-top: 2.4cm;
margin-left: 0.8cm;
margin-top: 2cm;
margin-left: 1.9cm;
padding-right: 0.2cm;
}
@ -76,7 +77,7 @@
font-size: 1em;
position: absolute;
width: 50%;
margin-top: 2.9cm;
margin-top: 2.4cm;
margin-left: 3cm;
text-align: right;
padding-right: 0.2cm;
@ -87,8 +88,8 @@
font-size: 0.6em;
position: absolute;
width: 50%;
margin-top: 3cm;
margin-left: 0.8cm;
margin-top: 2.55cm;
margin-left: 1.9cm;
text-align: left;
padding-right: 0.2cm;
}

View file

@ -12,6 +12,7 @@
<field name="arch" type="xml">
<field name="tag_ids" position="after">
<field name="origin" />
<field name="expiration_date" />
<field name="ingredients" />
<field name="code_balance" />
</field>

View file

@ -2,91 +2,89 @@
<odoo>
<template id="report_product_label_shelf" >
<t t-name="report_product_label_shelf">
<t t-call="web.basic_layout">
<t t-foreach="category_data['lines']" t-as="line">
<t t-set="product" t-value="line.product_id.product_tmpl_id" />
<div class="pricetag_container" >
<div class="product_name" >
<span t-field="product.name"/>
</div>
<!-- <t t-if="product.default_code">
<div class="product_code" >
ref.<span t-field="product.default_code"/>
</div>
</t> -->
<t t-if="product.origin">
<div class="product_state" >
<span t-field="product.origin"/>
</div>
</t>
<div class="product_labels" >
<t t-foreach="product.tag_ids" t-as="label">
<img t-attf-src="data:image/*;base64,{{label.image}}" t-att-alt="label.name"/>
</t>
</div>
<div class="product_member_price" >
<t t-set="members_price" t-value="product.get_price_member()" />
<span>PVS</span>
<strong><span
t-out="members_price"
t-options='{"widget": "float", "precision": 2}'
/> €</strong>
</div>
<div class="product_price_per_uom_member floating_box">
<t t-if="product.volume">
<t
t-set="price_uom"
t-value="round(members_price / (product.volume), 2)"
/>
<span
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(members_price / (product.net_weight), 2)"
/>
<span
t-out="price_uom"
t-options='{"widget": "float", "precision": 2}' /> €/Kg.
</t>
</div>
<div class="product_public_price" >
<t
t-set="public_price"
t-value="round(product.get_price_public(), 2)"
/>
<span>PVP</span>
<strong><span
t-out="public_price" t-options='{"widget": "float", "precision": 2}'
/>
</strong>
</div>
<!-- Price per Kg or L -->
<div class="product_price_per_uom_public floating_box">
<t t-if="product.volume">
<t
t-set="price_uom"
t-value="round(public_price / (product.volume), 2)"
/>
<span
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(public_price / (product.net_weight), 2)"
/>
<span
t-out="price_uom"
t-options='{"widget": "float", "precision": 2}' /> €/Kg.
</t>
</div>
<t t-call="web.basic_layout">
<t t-foreach="category_data['lines']" t-as="line">
<t t-set="product" t-value="line.product_id.product_tmpl_id" />
<div class="pricetag_container" >
<div class="product_name" >
<span t-field="product.name"/>
</div>
</t>
<!-- <t t-if="product.default_code">
<div class="product_code" >
ref.<span t-field="product.default_code"/>
</div>
</t> -->
<t t-if="product.origin">
<div class="product_state" >
<span t-field="product.origin"/>
</div>
</t>
<div class="product_labels" >
<t t-foreach="product.tag_ids" t-as="label">
<img t-attf-src="data:image/*;base64,{{label.image}}" t-att-alt="label.name"/>
</t>
</div>
<div class="product_member_price" >
<t t-set="members_price" t-value="product.get_price_member()" />
<span>PVS</span>
<strong><span
t-out="members_price"
t-options='{"widget": "float", "precision": 2}'
/> €</strong>
</div>
<div class="product_price_per_uom_member floating_box">
<t t-if="product.volume">
<t
t-set="price_uom"
t-value="round(members_price / (product.volume), 2)"
/>
<span
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(members_price / (product.net_weight), 2)"
/>
<span
t-out="price_uom"
t-options='{"widget": "float", "precision": 2}' /> €/Kg.
</t>
</div>
<div class="product_public_price" >
<t
t-set="public_price"
t-value="round(product.get_price_public(), 2)"
/>
<span>PVP</span>
<strong><span
t-out="public_price" t-options='{"widget": "float", "precision": 2}'
/>
</strong>
</div>
<!-- Price per Kg or L -->
<div class="product_price_per_uom_public floating_box">
<t t-if="product.volume">
<t
t-set="price_uom"
t-value="round(public_price / (product.volume), 2)"
/>
<span
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(public_price / (product.net_weight), 2)"
/>
<span
t-out="price_uom"
t-options='{"widget": "float", "precision": 2}' /> €/Kg.
</t>
</div>
</div>
</t>
</t>
</template>