From 1e4d99eeded6df021628e87bd2c644d09d3a63c4 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 6 Feb 2014 14:20:39 +0100 Subject: [PATCH] [MERGE] backport trunk revisions * 9094 fva@openerp.com-20140203144847-21cv7pt7lnlxdsve * 9095 fva@openerp.com-20140203153233-zj12w2o1uxyz5hoq bzr revid: chs@openerp.com-20140206132039-y1whtc8qqqs8ey92 --- addons/hw_escpos/controllers/main.py | 4 ++-- addons/point_of_sale/static/src/js/screens.js | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py index c668a1ffdd7..52307318870 100644 --- a/addons/hw_escpos/controllers/main.py +++ b/addons/hw_escpos/controllers/main.py @@ -65,7 +65,7 @@ class EscposDriver(Thread): self.push_task('status') return self.status - def open_cashbox(printer): + def open_cashbox(self,printer): printer.cashdraw(2) printer.cashdraw(5) @@ -103,7 +103,7 @@ class EscposDriver(Thread): self.print_receipt_body(printer,data) printer.cut() elif task == 'cashbox': - if timestamp >= time.time() * 12: + if timestamp >= time.time() - 12: self.open_cashbox(printer) elif task == 'status': pass diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 7860de8b328..cbd6779f33c 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -936,12 +936,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa document.body.addEventListener('keyup', this.hotkey_handler); - if( this.pos.config.iface_cashdrawer - && this.pos.get('selectedOrder').get('paymentLines').find( function(pl){ - return pl.cashregister.journal.type === 'cash'; - })){ - this.pos.proxy.open_cashbox(); - } this.add_action_button({ @@ -1145,6 +1139,13 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa return; } + if( this.pos.config.iface_cashdrawer + && this.pos.get('selectedOrder').get('paymentLines').find( function(pl){ + return pl.cashregister.journal.type === 'cash'; + })){ + this.pos.proxy.open_cashbox(); + } + if(options.invoice){ // deactivate the validation button while we try to send the order this.pos_widget.action_bar.set_button_disabled('validation',true);