[FIX] point_of_sale: add product variant in the displayed name (opw 607456)
authorMartin Trigaux <mat@openerp.com>
Fri, 16 May 2014 12:06:17 +0000 (14:06 +0200)
committerMartin Trigaux <mat@openerp.com>
Fri, 16 May 2014 12:06:17 +0000 (14:06 +0200)
addons/point_of_sale/static/src/js/db.js
addons/point_of_sale/static/src/js/models.js

index e0f4fd6..516637a 100644 (file)
@@ -169,6 +169,9 @@ function openerp_pos_db(instance, module){
                 var product = products[i];
                 var search_string = this._product_search_string(product);
                 var categ_id = product.pos_categ_id ? product.pos_categ_id[0] : this.root_category_id;
+                if (product.variants){
+                    product.name = product.name+" ("+product.variants+")";
+                }
                 if(!stored_categories[categ_id]){
                     stored_categories[categ_id] = [];
                 }
index 6fe4db6..b7b36d0 100644 (file)
@@ -175,7 +175,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
 
                     return self.fetch(
                         'product.product', 
-                        ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code',
+                        ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants',
                          'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
                         [['sale_ok','=',true],['available_in_pos','=',true]],
                         {pricelist: self.get('shop').pricelist_id[0]} // context for price