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',
|
'name': 'Product Library',
|
||||||
'category': 'Product',
|
'category': 'Product',
|
||||||
'summary': 'Add library related fields to product',
|
'summary': 'Add library related fields to product',
|
||||||
'version': '12.0.1.0.0',
|
'version': '12.0.1.0.1',
|
||||||
'description': """
|
'description': """
|
||||||
|
|
||||||
Addon mejora de Odoo para librerías y tiendas de discos
|
Addon mejora de Odoo para librerías y tiendas de discos
|
||||||
==================================================
|
==================================================
|
||||||
* Añade campos a product: Editorial, autor, género, formato,...
|
* Añade campos a product: Editorial, autor, género, formato,...
|
||||||
* Hace búsquedas en el TPV y backend en esos campos nuevos
|
* 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',
|
'author': 'Criptomart',
|
||||||
|
@ -18,12 +20,18 @@ Addon mejora de Odoo para librerías y tiendas de discos
|
||||||
'product',
|
'product',
|
||||||
'point_of_sale',
|
'point_of_sale',
|
||||||
],
|
],
|
||||||
|
'external_dependencies': {'python': [], 'bin': []},
|
||||||
'data': [
|
'data': [
|
||||||
'views/product.xml',
|
'views/product.xml',
|
||||||
'views/templates.xml'
|
'views/templates.xml'
|
||||||
],
|
],
|
||||||
|
'qweb': ['static/src/xml/pos.xml'],
|
||||||
'demo': [],
|
'demo': [],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
'application': True,
|
'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('autor');
|
||||||
product_model.fields.push('editorial');
|
product_model.fields.push('editorial');
|
||||||
product_model.fields.push('genero');
|
product_model.fields.push('genero');
|
||||||
|
product_model.fields.push('formato');
|
||||||
return _super_posmodel.initialize.apply(this, arguments);
|
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>
|
<odoo>
|
||||||
|
|
||||||
<template id="assets_backend" name="product_library" inherit_id="point_of_sale.assets">
|
<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/product_library.js"></script>
|
||||||
<script type="text/javascript" src="/product_library/static/src/js/db.js"/>
|
<script type="text/javascript" src="/product_library/static/src/js/db.js"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//link[@id='pos-stylesheet']" position="after">
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="/product_library/static/src/css/pos.css"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
</template>
|
</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>
|
</odoo>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue