Muestra el campo formato en la ficha de producto y en las línea de la orden

This commit is contained in:
santiky 2021-08-22 22:47:17 +02:00
parent 0e2919d1eb
commit 2a4ffee914
Signed by: snt
GPG key ID: A9FD34930EADBE71
5 changed files with 80 additions and 1 deletions

View file

@ -0,0 +1,19 @@
.pos .product .format {
position: absolute;
top: 2px;
left: 2px;
vertical-align: top;
color: white;
line-height: 13px;
background: #7f82ac;
padding: 2px 5px;
border-radius: 2px;
font-weight: bold;
}
.pos .order .orderline .format {
color: #777;
font-weight: bold;
font-style: normal;
}

View file

@ -22,6 +22,7 @@ Overload models.PosModel
product_model.fields.push('autor');
product_model.fields.push('editorial');
product_model.fields.push('genero');
product_model.fields.push('formato');
return _super_posmodel.initialize.apply(this, arguments);
}
});

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--Copyright 2021 Criptomart <https://criptomart.net> -->
<templates id="template" xml:space="preserve">
<t t-extend="Product">
<t t-jquery=".product-name" t-operation="after">
<!-- <t t-if="widget.pos.config.show_format &amp;&amp; product.type == 'product'"> -->
<span t-attf-class="format" >
<t t-esc="product.formato" />
</span>
</t>
<!-- </t> -->
</t>
<t t-extend="Orderline">
<!-- <t t-jquery=".product-name" t-operation="after">
<span t-attf-class="format" >
<t t-esc="product.formato" />
</span>
</t> -->
<t t-jquery=".product-name" t-operation="after">
<!-- <t t-if="widget.pos.config.show_format &amp;&amp; line.get_product().type == 'product'" > -->
<div t-attf-class="format" >
<t t-esc="line.get_product().formato" />
</div>
<!-- </t> -->
</t>
</t>
</templates>