diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js index b605e8ee884..35ac343b6b2 100644 --- a/addons/point_of_sale/static/src/js/devices.js +++ b/addons/point_of_sale/static/src/js/devices.js @@ -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; },