From 107e579ecdfb0ab8d20fb2e532a17967fc51350b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 14 Nov 2012 17:50:43 +0100 Subject: [PATCH] [IMP] point_of_sale: auto focus on paymentlines bzr revid: fva@openerp.com-20121114165043-vbfj1r93ww3es9qt --- addons/point_of_sale/static/src/js/screens.js | 3 ++- addons/point_of_sale/static/src/js/widgets.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 0b8ab70a9c0..d8e53066c1e 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -899,7 +899,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }); this.updatePaymentSummary(); - this.$('.paymentline-amout input').last().focus(); }, close: function(){ this._super(); @@ -946,6 +945,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa self.deleteLine(r); }); x.appendTo(this.$('#paymentlines')); + this.$('.paymentline-amount input:last').focus(); }, renderElement: function() { this._super(); @@ -975,6 +975,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa if(this.pos_widget.action_bar){ this.pos_widget.action_bar.set_button_disabled('validation', remaining > 0); } + this.$('.paymentline-amount input:last').focus(); }, set_numpad_state: function(numpadState) { if (this.numpadState) { diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index bc5f29601a8..94d6a5dc57e 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -298,8 +298,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.payment_line.bind('change', this.changedAmount, this); }, changeAmount: function(event) { - var newAmount; - newAmount = event.currentTarget.value; + var newAmount = event.currentTarget.value; if (newAmount && !isNaN(newAmount)) { this.amount = parseFloat(newAmount); this.payment_line.set_amount(this.amount);