Muestra el campo formato en la ficha de producto y en las línea de la orden
This commit is contained in:
parent
0e2919d1eb
commit
2a4ffee914
5 changed files with 80 additions and 1 deletions
|
@ -4,13 +4,15 @@
|
|||
'name': 'Product Library',
|
||||
'category': 'Product',
|
||||
'summary': 'Add library related fields to product',
|
||||
'version': '12.0.1.0.0',
|
||||
'version': '12.0.1.0.1',
|
||||
'description': """
|
||||
|
||||
Addon mejora de Odoo para librerías y tiendas de discos
|
||||
==================================================
|
||||
* Añade campos a product: Editorial, autor, género, formato,...
|
||||
* Hace búsquedas en el TPV y backend en esos campos nuevos
|
||||
* Búsqueda sin acentos en el PoS
|
||||
* Muestra el campo formato en el PoS en los productos y en las líneas de la orden
|
||||
|
||||
""",
|
||||
'author': 'Criptomart',
|
||||
|
@ -18,12 +20,18 @@ Addon mejora de Odoo para librerías y tiendas de discos
|
|||
'product',
|
||||
'point_of_sale',
|
||||
],
|
||||
'external_dependencies': {'python': [], 'bin': []},
|
||||
'data': [
|
||||
'views/product.xml',
|
||||
'views/templates.xml'
|
||||
],
|
||||
'qweb': ['static/src/xml/pos.xml'],
|
||||
'demo': [],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'application': True,
|
||||
"post_load": None,
|
||||
"pre_init_hook": None,
|
||||
"post_init_hook": None,
|
||||
"uninstall_hook": None,
|
||||
}
|
||||
|
|
19
product_library/static/src/css/pos.css
Normal file
19
product_library/static/src/css/pos.css
Normal 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;
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
29
product_library/static/src/xml/pos.xml
Normal file
29
product_library/static/src/xml/pos.xml
Normal 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 && 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 && line.get_product().type == 'product'" > -->
|
||||
<div t-attf-class="format" >
|
||||
<t t-esc="line.get_product().formato" />
|
||||
</div>
|
||||
<!-- </t> -->
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</templates>
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<template id="assets_backend" name="product_library" inherit_id="point_of_sale.assets">
|
||||
|
@ -5,6 +6,27 @@
|
|||
<script type="text/javascript" src="/product_library/static/src/js/product_library.js"></script>
|
||||
<script type="text/javascript" src="/product_library/static/src/js/db.js"/>
|
||||
</xpath>
|
||||
<xpath expr="//link[@id='pos-stylesheet']" position="after">
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="/product_library/static/src/css/pos.css"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!--
|
||||
<template
|
||||
id="assets_backend_web"
|
||||
name="product_library_backend_assets"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/pos_library/static/src/js/test_pos_format.js"
|
||||
/>
|
||||
</xpath>
|
||||
</template> -->
|
||||
|
||||
</odoo>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue