diff --git a/addons/point_of_sale/point_of_sale_demo.xml b/addons/point_of_sale/point_of_sale_demo.xml index 011c6d81bfc..390d4750e14 100644 --- a/addons/point_of_sale/point_of_sale_demo.xml +++ b/addons/point_of_sale/point_of_sale_demo.xml @@ -290,7 +290,7 @@ True 5.10 - Fishing + Peaches True 2300001000008 diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js index e7d0376938c..835b7fe7b5a 100644 --- a/addons/point_of_sale/static/src/js/devices.js +++ b/addons/point_of_sale/static/src/js/devices.js @@ -12,6 +12,8 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal this.weight = 0; this.weighting = false; + this.debug_weight = 0; + this.use_debug_weight = false; this.paying = false; this.default_payment_status = { @@ -92,38 +94,36 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal // and a weighting_end() weighting_read_kg: function(){ var self = this; - if(this.bypass_proxy){ - return this.weight; - }else{ - this.message('weighting_read_kg',{}) - .done(function(weight){ - if(self.weighting && !self.bypass_proxy){ + this.message('weighting_read_kg',{}) + .done(function(weight){ + if(self.weighting){ + if(self.use_debug_weight){ + self.weight = self.debug_weight; + }else{ self.weight = weight; } - }); - return this.weight; - } + } + }); + return this.weight; }, // sets a custom weight, ignoring the proxy returned value. debug_set_weight: function(kg){ - this.bypass_proxy = true; - this.weight = kg; + this.use_debug_weight = true; + this.debug_weight = kg; }, // resets the custom weight and re-enable listening to the proxy for weight values debug_reset_weight: function(){ - this.bypass_proxy = false; - this.weight = 0; + this.use_debug_weight = false; + this.debug_weight = 0; }, // the client has finished weighting products weighting_end: function(){ - if(!this.bypass_proxy){ - this.weight = 0; - this.weighting = false; - this.message('weighting_end'); - } + this.weight = 0; + this.weighting = false; + this.message('weighting_end'); }, // the pos asks the client to pay 'price' units diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 98ba49c8856..2538f36eb13 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -104,7 +104,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('company').currency_id[0]]]); }).then(function(currencies){ - console.log('Currency:',currencies[0]); self.set('currency',currencies[0]); return self.fetch('product.uom', null, null); @@ -234,8 +233,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal on_removed_order: function(removed_order){ if( this.get('orders').isEmpty()){ this.add_new_order(); - } - if( this.get('selectedOrder') === removed_order){ + }else{ this.set({ selectedOrder: this.get('orders').last() }); } }, diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index d6ae2d4819b..20253ffd27b 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -459,7 +459,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png', click: function(){ clearInterval(this.intervalID); - self.pos.proxy.weighting_end(); self.pos_widget.screen_selector.set_current_screen(self.previous_screen); } }); diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 96ccd85134d..24660ab6377 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -743,6 +743,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa } }); this.$('.button.reset_weight').click(function(){ + self.$('input.weight').val(''); self.pos.proxy.debug_reset_weight(); }); this.$('.button.custom_ean').click(function(){