[WIP] point_of_sale: removed the payment method selection from the paypad, as the...
authorFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>
Tue, 29 Jul 2014 16:07:29 +0000 (18:07 +0200)
committerFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>
Tue, 29 Jul 2014 16:07:29 +0000 (18:07 +0200)
addons/point_of_sale/static/src/css/pos.css
addons/point_of_sale/static/src/js/widgets.js
addons/point_of_sale/static/src/xml/pos.xml

index c3358e7..64e62f3 100644 (file)
@@ -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;
index 84aa163..c594387 100644 (file)
@@ -83,44 +83,19 @@ 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');
             });
-        }
-    });
-
-    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');
+            this.$('.set-customer').click(function(){
+                self.pos.pos_widget.screen_selector.set_current_screen('clientlist');
             });
-        },
+        }
     });
 
     module.OrderWidget = module.PosBaseWidget.extend({
@@ -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();
                 }
             }
         },
index d596862..6af641d 100644 (file)
@@ -36,7 +36,7 @@
                             <div class='subwindow-container'>
                                 <div class='subwindow-container-fix pads'>
                                     <div class="control-buttons oe_hidden"></div>
-                                    <div class="placeholder-PaypadWidget"></div>
+                                    <div class="placeholder-ActionpadWidget"></div>
                                     <div class="placeholder-NumpadWidget"></div>
                                 </div>
                             </div>
         <div>There are pending operations that could not be saved into the database, are you sure you want to exit?</div>
     </t>
 
-    <t t-name="PaypadWidget">
-        <div class="paypad touch-scrollable">
+    <t t-name="ActionpadWidget">
+        <div class='actionpad'>
+            <button class='button set-customer'>
+                <i class='fa fa-user' /> Set Customer
+            </button>
+            <button class="button pay">
+                <i class='fa fa-dollar' /> Payment
+            </button>
         </div>
     </t>
 
         </tr>
     </t>
 
-    <t t-name="PaypadButtonWidget">
-        <button class="paypad-button" t-att-cash-register-id="widget.cashregister.id">
-            <t t-esc="widget.cashregister.journal.name"/>
-        </button>
-    </t>
-
     <t t-name="OrderButtonWidget">
         <span class="order-button select-order">
             <t t-if='widget.selected'>