Przeglądaj źródła

[FIX] Limpieza de codigo y correcion del product_uom

Rodney Elpidio Enciso Arias 7 lat temu
rodzic
commit
64d4e71844

+ 1 - 2
model/sale_order.py

@@ -19,9 +19,8 @@ class SaleOrder(models.Model):
 				'order_id': x['order_id'],
 				'order_id': x['order_id'],
                 'product_id': x['product_id'],
                 'product_id': x['product_id'],
                 'product_uom_qty': x['product_uom_qty'],
                 'product_uom_qty': x['product_uom_qty'],
-                'product_uos': x['product_uos'],
+                'product_uom': x['product_uos'],
 			})
 			})
-			# print sale_order_line
 			new_line.create(sale_order_line)
 			new_line.create(sale_order_line)
 
 
 	@api.depends('order_line.price_subtotal')
 	@api.depends('order_line.price_subtotal')

BIN
model/sale_order.pyc


+ 17 - 2
static/src/js/main.js

@@ -11,7 +11,6 @@ openerp.eiru_purchase_to_sale = function (instance, local) {
         init:function(parent){
         init:function(parent){
             this._super(parent);
             this._super(parent);
             this.buttons = parent.$buttons;
             this.buttons = parent.$buttons;
-
         },
         },
 
 
         updateId : function(id){
         updateId : function(id){
@@ -25,9 +24,26 @@ openerp.eiru_purchase_to_sale = function (instance, local) {
 
 
         start: function () {
         start: function () {
             var self = this;
             var self = this;
+
             this.$el.click(function () {
             this.$el.click(function () {
                 self.fecthInitial();
                 self.fecthInitial();
             });
             });
+
+            self.buttons.click(function(e) {
+                /* C (Crear) */
+                if (e.target.accessKey === 'C'){
+                    self.$el.css('display','none');
+                }
+                /* E (Editar) */
+                if (e.target.accessKey === 'E')
+                    self.$el.css('display','none');
+                /* S (Guardar) */
+                if (e.target.accessKey === 'S')
+                    self.$el.css('display','flex');
+                /* D (Cancelar) */
+                if (e.target.accessKey === 'D')
+                    self.$el.css('display','flex');
+            });
         },
         },
 
 
         fecthInitial: function(){
         fecthInitial: function(){
@@ -161,7 +177,6 @@ openerp.eiru_purchase_to_sale = function (instance, local) {
                     self.reloadLine();
                     self.reloadLine();
                 });
                 });
             }
             }
-            // console.log(data);
         },
         },
 
 
         joinSaleLine: function(data) {
         joinSaleLine: function(data) {

+ 2 - 13
static/src/xml/modal/purchase_modal.xml

@@ -11,9 +11,9 @@
                             <t t-esc="title_value.title"/>
                             <t t-esc="title_value.title"/>
                         </h3>
                         </h3>
                     </div>
                     </div>
+                    <!-- table -->
                     <div class="oe_view_manager_body table-model">
                     <div class="oe_view_manager_body table-model">
-                        <!-- tabla Head -->
-                        <div class="modal-head-wrapper">
+                        <div class="modal-items-wrapper">
                             <table class="oe_list_content">
                             <table class="oe_list_content">
                                 <thead >
                                 <thead >
                                     <tr class="oe_list_header_columns" >
                                     <tr class="oe_list_header_columns" >
@@ -22,18 +22,7 @@
                                         </th>
                                         </th>
                                     </tr>
                                     </tr>
                                 </thead>
                                 </thead>
-                            </table>
-                        </div>
-                        <!-- table body -->
-                        <div class="modal-items-wrapper">
-                            <table class="oe_list_content">
                                 <tbody class="table-tbody">
                                 <tbody class="table-tbody">
-                                    <!-- <colgroup>
-                                        <col width='30%'/>
-                                        <col width='20%'/>
-                                        <col width='30%'/>
-                                        <col width='20%'/>
-                                    </colgroup> -->
                                     <tr t-foreach="data" t-as="field">
                                     <tr t-foreach="data" t-as="field">
                                         <td style="display:none;"><t t-esc="field_value.id"/></td>
                                         <td style="display:none;"><t t-esc="field_value.id"/></td>
                                         <td><t t-esc="field_value.partner_id[1]"/></td>
                                         <td><t t-esc="field_value.partner_id[1]"/></td>

+ 1 - 1
static/src/xml/view.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <template xml:space="preserve">
 <template xml:space="preserve">
     <t t-name="eiru_purchase_to_sale.PurchaseToSale">
     <t t-name="eiru_purchase_to_sale.PurchaseToSale">
-        <button type="button" class="oe_button oe_form_button oe_highlight order">Pedidos</button>
+        <button type="button" class="oe_button oe_form_button oe_highlight order"> Pedidos </button>
     </t>
     </t>
 </template>
 </template>