[FIX] point_of_sale: display an error when trying to print a receipt on an outdated posbox

This commit is contained in:
Frederic van der Essen 2014-09-09 16:14:27 +02:00
parent ef5b078b74
commit 7cf5f0a8a8
1 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,6 @@
function openerp_pos_devices(instance,module){ //module is instance.point_of_sale
var _t = instance.web._t;
// the JobQueue schedules a sequence of 'jobs'. each job is
// a function returning a deferred. the queue waits for each job to finish
@ -88,6 +89,8 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
var self = this;
options = options || {};
url = options.url || 'http://localhost:8069';
this.pos = parent;
this.weighting = false;
this.debug_weight = 0;
@ -410,7 +413,14 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
self.message('print_xml_receipt',{ receipt: r },{ timeout: 5000 })
.then(function(){
send_printing_job();
},function(){
},function(error){
if (error) {
self.pos.pos_widget.screen_selector.show_popup('error',{
'message': _t('PosBox Printing Error'),
'comment': _t("The receipt could not be printed. The software installed on the posbox is probably out of date. Please refer to the software instructions in the posbox manual or contact the customer support"),
});
return;
}
self.receipt_queue.unshift(r)
});
}