[FIX] point_of_sale: the electronic scale is now always deactivated
bzr revid: fva@openerp.com-20121122132248-qfxbs04z9tunoi8l
This commit is contained in:
@@ -79,10 +79,11 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
|
||||
//the client is starting to weight
|
||||
weighting_start: function(){
|
||||
if(!this.weighting){
|
||||
this.weight = 0;
|
||||
this.weighting = true;
|
||||
this.bypass_proxy = false;
|
||||
return this.message('weighting_start');
|
||||
if(!this.bypass_proxy){
|
||||
this.weight = 0;
|
||||
return this.message('weighting_start');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -104,18 +105,25 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
|
||||
}
|
||||
},
|
||||
|
||||
// sets a custom weight, ignoring the proxy returned value until the next weighting_end
|
||||
// sets a custom weight, ignoring the proxy returned value.
|
||||
debug_set_weight: function(kg){
|
||||
this.bypass_proxy = true;
|
||||
this.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;
|
||||
},
|
||||
|
||||
// the client has finished weighting products
|
||||
weighting_end: function(){
|
||||
this.weight = 0;
|
||||
this.weighting = false;
|
||||
this.bypass_proxy = false;
|
||||
return this.message('weighting_end');
|
||||
if(!this.bypass_proxy){
|
||||
this.weight = 0;
|
||||
this.weighting = false;
|
||||
this.message('weighting_end');
|
||||
}
|
||||
},
|
||||
|
||||
// the pos asks the client to pay 'price' units
|
||||
|
||||
@@ -467,6 +467,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
||||
close: function(){
|
||||
this._super();
|
||||
clearInterval(this.intervalID);
|
||||
this.pos.proxy.weighting_end();
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -712,6 +712,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
||||
self.pos.proxy.debug_set_weight(kg);
|
||||
}
|
||||
});
|
||||
this.$('.button.reset_weight').click(function(){
|
||||
self.pos.proxy.debug_reset_weight();
|
||||
});
|
||||
this.$('.button.custom_ean').click(function(){
|
||||
var ean = self.pos.barcode_reader.sanitize_ean(self.$('input.ean').val() || '0');
|
||||
self.$('input.ean').val(ean);
|
||||
|
||||
@@ -445,6 +445,7 @@
|
||||
<ul>
|
||||
<li><input type="text" class="weight"></input></li>
|
||||
<li class="button set_weight">Set Weight</li>
|
||||
<li class="button reset_weight">Reset</li>
|
||||
</ul>
|
||||
|
||||
<p class="category">Barcode Scanner</p>
|
||||
|
||||
Reference in New Issue
Block a user