diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js index 9a74eec0c05..7e847abdc32 100644 --- a/addons/point_of_sale/static/src/js/devices.js +++ b/addons/point_of_sale/static/src/js/devices.js @@ -84,10 +84,11 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal weighting_start: function(){ if(!this.weighting){ this.weighting = true; - if(!this.bypass_proxy){ - this.weight = 0; - return this.message('weighting_start'); - } + this.weight = 0; + return this.message('weighting_start'); + }else{ + console.error('Weighting already started!!!'); + this.weight = 0; } }, @@ -96,6 +97,9 @@ 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.weighting){ + console.error('Weighting while not started!!!'); + } this.message('weighting_read_kg',{}) .done(function(weight){ if(self.weighting){ @@ -123,9 +127,14 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal // the client has finished weighting products weighting_end: function(){ - this.weight = 0; - this.weighting = false; - this.message('weighting_end'); + if(this.weighting){ + this.weight = 0; + this.weighting = false; + this.message('weighting_end'); + }else{ + console.error('Weighting already ended !!!'); + this.weight = 0; + } }, // the pos asks the client to pay 'price' units diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 8c588adadf3..f8bf0df1590 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -271,19 +271,19 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }); var self = this; - var cashier_mode = this.pos_widget.screen_selector.get_user_mode() === 'cashier'; + this.cashier_mode = this.pos_widget.screen_selector.get_user_mode() === 'cashier'; - this.pos_widget.set_numpad_visible(this.show_numpad && cashier_mode); + this.pos_widget.set_numpad_visible(this.show_numpad && this.cashier_mode); this.pos_widget.set_leftpane_visible(this.show_leftpane); - this.pos_widget.set_left_action_bar_visible(this.show_leftpane && !cashier_mode); - this.pos_widget.set_cashier_controls_visible(cashier_mode); + this.pos_widget.set_left_action_bar_visible(this.show_leftpane && !this.cashier_mode); + this.pos_widget.set_cashier_controls_visible(this.cashier_mode); - if(cashier_mode && this.pos.iface_self_checkout){ + if(this.cashier_mode && this.pos.iface_self_checkout){ this.pos_widget.client_button.show(); }else{ this.pos_widget.client_button.hide(); } - if(cashier_mode){ + if(this.cashier_mode){ this.pos_widget.close_button.show(); }else{ this.pos_widget.close_button.hide(); @@ -460,7 +460,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa clearInterval(this.intervalID); self.pos_widget.screen_selector.set_current_screen(self.next_screen); } - },100); + },50); this.add_action_button({ label: _t('Back'), @@ -512,9 +512,9 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa var weight = self.pos.proxy.weighting_read_kg(); if(weight != self.weight){ self.weight = weight; - self.renderElement(); + self.$('.js-weight').text(self.get_product_weight_string()); } - },100); + },50); }, renderElement: function(){ var self = this; @@ -544,8 +544,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa var product = this.get_product(); return (product ? product.get('price') : 0) || 0; }, - get_product_weight: function(){ - return this.weight || 0; + get_product_weight_string: function(){ + return (this.weight || 0).toFixed(3) + ' Kg'; }, close: function(){ this._super(); @@ -740,7 +740,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa module.ProductScreenWidget = module.ScreenWidget.extend({ template:'ProductScreenWidget', - scale_screen: 'scale_invite', + scale_screen: 'scale', + client_scale_screen : 'scale_invite', client_next_screen: 'client_payment', show_numpad: true, @@ -754,7 +755,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.product_list_widget = new module.ProductListWidget(this,{ click_product_action: function(product){ if(product.get('to_weight') && self.pos.iface_electronic_scale){ - self.pos_widget.screen_selector.set_current_screen(self.scale_screen, {product: product}); + self.pos_widget.screen_selector.set_current_screen( self.cashier_mode ? self.scale_screen : self.client_scale_screen, {product: product}); }else{ self.pos.get('selectedOrder').addProduct(product); } diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 9794b989b65..5c5faf3fc82 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -192,8 +192,9 @@
-