diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index c3358e71665..64e62f37d77 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -502,20 +502,20 @@ td { color: inherit; } -/* ********* The paypad contains the payment buttons ********* */ +/* ********* The actionpad (payment, set customer) ********* */ -.pos .paypad { - padding: 8px 4px 8px 8px; +.pos .actionpad{ + padding: 8px 3px 8px 19px; display: inline-block; text-align: center; vertical-align: top; - width: 205px; + width: 183px; max-height: 350px; overflow-y: auto; overflow-x: hidden; } -.pos .paypad button { - height: 39px; +.pos .actionpad .button { + height: 50px; display: block; width: 100%; margin: 0px -6px 4px -2px; @@ -524,13 +524,19 @@ td { color: #555555; font-size: 14px; } -.pos .paypad button:active, -.pos .numpad button:active, -.pos .numpad .selected-mode, -.pos .popup button:active{ - border: none; +.pos .actionpad .button.pay { + height: 158px; +} +.pos .actionpad .button.pay .fa { + display: block; + font-size: 32px; + line-height: 60px; + background: rgb(86, 86, 86); color: white; - background: #7f82ac; + width: 60px; + margin: auto; + border-radius: 30px; + margin-bottom: 10px; } /* ********* The Numpad ********* */ @@ -543,7 +549,7 @@ td { .pos .numpad button { height: 50px; width: 50px; - margin: 0px 0px 4px 0px; + margin: 0px 3px 4px 0px; font-weight: bold; vertical-align: middle; color: #555555; diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 84aa163f632..c5943870f41 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -83,46 +83,21 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa }, }); - // The paypad allows to select the payment method (cashregisters) - // used to pay the order. - module.PaypadWidget = module.PosBaseWidget.extend({ - template: 'PaypadWidget', + // The action pads contains the payment button and the customer selection button. + module.ActionpadWidget = module.PosBaseWidget.extend({ + template: 'ActionpadWidget', renderElement: function() { var self = this; this._super(); - - _.each(this.pos.cashregisters,function(cashregister) { - var button = new module.PaypadButtonWidget(self,{ - pos: self.pos, - pos_widget : self.pos_widget, - cashregister: cashregister, - }); - button.appendTo(self.$el); + this.$('.pay').click(function(){ + self.pos.pos_widget.screen_selector.set_current_screen('payment'); + }); + this.$('.set-customer').click(function(){ + self.pos.pos_widget.screen_selector.set_current_screen('clientlist'); }); } }); - module.PaypadButtonWidget = module.PosBaseWidget.extend({ - template: 'PaypadButtonWidget', - init: function(parent, options){ - this._super(parent, options); - this.cashregister = options.cashregister; - }, - renderElement: function() { - var self = this; - this._super(); - - this.$el.click(function(){ - if (self.pos.get('selectedOrder').get('screen') === 'receipt'){ //TODO Why ? - console.warn('TODO should not get there...?'); - return; - } - self.pos.get('selectedOrder').addPaymentline(self.cashregister); - self.pos_widget.screen_selector.set_current_screen('payment'); - }); - }, - }); - module.OrderWidget = module.PosBaseWidget.extend({ template:'OrderWidget', init: function(parent, options) { @@ -1156,8 +1131,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.action_bar = new module.ActionBarWidget(this); this.action_bar.replace(this.$(".placeholder-RightActionBar")); - this.paypad = new module.PaypadWidget(this, {}); - this.paypad.replace(this.$('.placeholder-PaypadWidget')); + this.actionpad = new module.ActionpadWidget(this, {}); + this.actionpad.replace(this.$('.placeholder-ActionpadWidget')); this.numpad = new module.NumpadWidget(this); this.numpad.replace(this.$('.placeholder-NumpadWidget')); @@ -1216,10 +1191,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.numpad_visible = visible; if(visible){ this.numpad.show(); - this.paypad.show(); + this.actionpad.show(); }else{ this.numpad.hide(); - this.paypad.hide(); + this.actionpad.hide(); } } }, diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index d596862b676..6af641d2fd2 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -36,7 +36,7 @@