From 7cf5f0a8a883eefb117cf81abff90c91700d9414 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Tue, 9 Sep 2014 16:14:27 +0200 Subject: [PATCH] [FIX] point_of_sale: display an error when trying to print a receipt on an outdated posbox --- addons/point_of_sale/static/src/js/devices.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js index 23dc8981866..71dfb101b2c 100644 --- a/addons/point_of_sale/static/src/js/devices.js +++ b/addons/point_of_sale/static/src/js/devices.js @@ -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) }); }