Add patch for POS

This commit is contained in:
Alexis de Lattre
2016-01-13 12:04:38 +01:00
parent 140349e4d8
commit ccc0684312
2 changed files with 29 additions and 1 deletions

View File

@@ -31,7 +31,9 @@
POS Second EAN13
================
This module adds a second EAN13 field on products. This feature has been asked by librairies that often have the same book available from 2 different sources with different EAN13 (to keep things simple, I didn't want to handle N EAN13 ; a second EAN13 was enough for most cases). This module also provides a patch to apply on the javascript of the official *point_of_sale* module.
This module adds a second EAN13 field on products. This feature has been asked by librairies that often have the same book available from 2 different sources with different EAN13 (to keep things simple, I didn't want to handle N EAN13 ; a second EAN13 was enough for most cases). This module also provides a patch to apply on the source code of Odoo (file *patch-point_of_sale-second_ean13.diff*) : this patch modifies the javascript code of the official *point_of_sale* module of Odoo.
I recommend to also install the module *pos_no_product_template_menu* because the second EAN13 is only shown in the product.product form view (I don't want to add the hack to have the second EAN13 field on product.template form view, in order to keep this module as simple as possible).
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
""",

View File

@@ -0,0 +1,26 @@
diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js
index 819c21f..317eda9 100644
--- a/addons/point_of_sale/static/src/js/db.js
+++ b/addons/point_of_sale/static/src/js/db.js
@@ -188,6 +188,9 @@ function openerp_pos_db(instance, module){
if(product.ean13){
this.product_by_ean13[product.ean13] = product;
}
+ if(product.second_ean13){
+ this.product_by_ean13[product.second_ean13] = product;
+ }
if(product.default_code){
this.product_by_reference[product.default_code] = product;
}
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 0bd1b99..86e8b2f 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -282,6 +282,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
model: 'product.product',
fields: ['display_name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code',
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description',
+ 'second_ean13',
'product_tmpl_id'],
domain: [['sale_ok','=',true],['available_in_pos','=',true]],
context: function(self){ return { pricelist: self.pricelist.id, display_default_code: false }; },