Foram Katharotiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1099400-fka into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1099400 in OpenERP Addons: "[Trunk/7.0][PoS Frontend] adding a product, 
then another, then again the first product: prices do not stack for the same 
product"
  https://bugs.launchpad.net/openobject-addons/+bug/1099400

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1099400-fka/+merge/144302

Hello,

 - I have fixed the issue of add several lines of product in pos frontend 
session when add same product after onther product.

Thanks,
FKA
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1099400-fka/+merge/144302
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1099400-fka.
=== modified file 'point_of_sale/static/src/js/models.js'
--- point_of_sale/static/src/js/models.js	2013-01-11 14:42:19 +0000
+++ point_of_sale/static/src/js/models.js	2013-01-22 12:53:22 +0000
@@ -588,10 +588,25 @@
             }
 
             var last_orderline = this.getLastOrderline();
-            if( last_orderline && last_orderline.can_be_merged_with(line) && options.merge !== false){
-                last_orderline.merge(line);
-            }else{
+            if (this.get('orderLines').models.length == 0 ){
                 this.get('orderLines').add(line);
+            }else{
+                var exiting
+                this.get('orderLines').each(function(orderlines){
+                    var order = orderlines.product.id;
+                    if (line.product.id == order & last_orderline.product.id != orderlines.product.id){
+                            exiting = line.product.id;
+                            orderlines.merge(line);
+                    }
+                    if (last_orderline && line.product.id == order && last_orderline.can_be_merged_with(line) && options.merge !== false){
+                            exiting = line.product.id;
+                            last_orderline.merge(line);
+                    }
+                    
+                });
+                if (exiting == undefined){
+                    this.get('orderLines').add(line);
+                }
             }
             this.selectLine(this.getLastOrderline());
         },

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to