[FIX] point_of_sale: scale debug was not working with an unplugged scale
This commit is contained in:
parent
0b18a5afec
commit
932257150b
|
@ -370,13 +370,14 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
|
|||
scale_read: function(){
|
||||
var self = this;
|
||||
var ret = new $.Deferred();
|
||||
console.log('scale_read');
|
||||
if (self.use_debug_weight) {
|
||||
return (new $.Deferred()).resolve({weight:this.debug_weight, unit:'Kg', info:'ok'});
|
||||
}
|
||||
this.message('scale_read',{})
|
||||
.then(function(weight){
|
||||
console.log(weight)
|
||||
ret.resolve(self.use_debug_weight ? self.debug_weight : weight);
|
||||
ret.resolve(weight);
|
||||
}, function(){ //failed to read weight
|
||||
ret.resolve(self.use_debug_weight ? self.debug_weight : {weight:0.0, unit:'Kg', info:'ok'});
|
||||
ret.resolve({weight:0.0, unit:'Kg', info:'ok'});
|
||||
});
|
||||
return ret;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue