瀏覽代碼

[ADD] agregado el campo departamento en el registro del cliente

Rodney Elpidio Enciso Arias 6 年之前
父節點
當前提交
ab553eae34
共有 3 個文件被更改,包括 38 次插入6 次删除
  1. 10 1
      static/src/js/customer.js
  2. 1 2
      static/src/js/screen.js
  3. 27 3
      static/src/xml/pos.xml

+ 10 - 1
static/src/js/customer.js

@@ -21,4 +21,13 @@ function pos_customer(instance, module){
             return loaded;
         },
     });
-}
+
+    module.PosModel.prototype.models.push({
+        model: "res.country.state",
+        fields: ["id","complete_name"],
+        domain: function(self){},
+        loaded: function(self, states){
+            self.states = states;
+        },
+    });
+}

+ 1 - 2
static/src/js/screen.js

@@ -18,7 +18,6 @@ function pos_screens(instance, module){
         show: function(){
             var self = this;
             this._super();
-
             this.renderElement();
             this.details_visible = false;
             this.old_client = this.pos.get('selectedOrder').get('client');
@@ -382,4 +381,4 @@ function pos_screens(instance, module){
             this._super();
         },
     });
-}
+}

+ 27 - 3
static/src/xml/pos.xml

@@ -11,13 +11,37 @@
         </t>
     </t>
 
+    <t t-extend="ClientDetails">
+        <t t-jquery="div.client-details-right>div:first-child" t-operation="before">
+            <div class='client-detail'>
+                <span class='label'>Dep.</span>
+                <span class='detail client-state'><t t-esc='partner.state_id[1]'/></span>
+            </div>
+        </t>
+    </t>
+
     <!-- Editar Formulario -->
     <t t-extend="ClientDetailsEdit">
-        <t t-jquery="div.client-details-left>div:first-child" t-operation="before"> 
+        <t t-jquery="div.client-details-left>div:first-child" t-operation="before">
             <div class='client-detail'>
                 <span class='label'>RUC</span>
                 <input class='detail client-ruc' name='ruc' t-att-value='partner.ruc' placeholder='RUC-DNI'></input>
-            </div>   
+            </div>
+        </t>
+    </t>
+    <t t-extend="ClientDetailsEdit">
+        <t t-jquery="div.client-details-right>div:first-child" t-operation="before">
+            <div class='client-detail'>
+                <span class='label'>Dep.</span>
+                <select class='detail client-address-states needsclick' name='state_id'>
+                    <option value=''>None</option>
+                    <t t-foreach='widget.pos.states' t-as='state'>
+                        <option t-att-value='state.id' t-att-selected="partner.state_id ? ((state.id === partner.state_id[0]) ? true : undefined) : undefined">
+                            <t t-esc='state.complete_name'/>
+                        </option>
+                    </t>
+                </select>
+            </div>
         </t>
     </t>
-</templates>
+</templates>