소스 검색

[FIX] modificacion en el domain de busqueda

Rodney Elpidio Enciso Arias 6 년 전
부모
커밋
8ed9b2e168
3개의 변경된 파일12개의 추가작업 그리고 5개의 파일을 삭제
  1. 7 1
      wizards/sale_order_barcode.py
  2. BIN
      wizards/sale_order_barcode.pyc
  3. 5 4
      wizards/sale_order_barcode_view.xml

+ 7 - 1
wizards/sale_order_barcode.py

@@ -18,6 +18,11 @@ class SaleOrderBarcode(models.TransientModel):
         comodel_name='product.product',
         comodel_name='product.product',
         string='Product',
         string='Product',
         required=True)
         required=True)
+    product_name = fields.Many2one(
+        comodel_name='product.product',
+        string='Product',
+        related='product_id')
+
     product_qty = fields.Float(
     product_qty = fields.Float(
         string='Quantity',
         string='Quantity',
         digits=dp.get_precision('Product Unit of Measure'),
         digits=dp.get_precision('Product Unit of Measure'),
@@ -40,7 +45,7 @@ class SaleOrderBarcode(models.TransientModel):
     def _prepare_domain(self):
     def _prepare_domain(self):
         self.ensure_one()
         self.ensure_one()
         domain = [
         domain = [
-            ('ean13', '=', self.product_barcode),
+            ('ean13', 'like', self.product_barcode),
             ('sale_ok', '=', True)
             ('sale_ok', '=', True)
         ]
         ]
         return domain
         return domain
@@ -98,6 +103,7 @@ class SaleOrderBarcode(models.TransientModel):
     def product_id_onchange(self):
     def product_id_onchange(self):
         if self.product_id:
         if self.product_id:
             self.product_uom_id = self.product_id.uom_id.id
             self.product_uom_id = self.product_id.uom_id.id
+            # self.create_sale_order_line()
 
 
     @api.multi
     @api.multi
     def create_sale_order_line(self):
     def create_sale_order_line(self):

BIN
wizards/sale_order_barcode.pyc


+ 5 - 4
wizards/sale_order_barcode_view.xml

@@ -9,19 +9,20 @@
                 <form string="Sale Order Barcode Wizard">
                 <form string="Sale Order Barcode Wizard">
                     <group name="product">
                     <group name="product">
                         <field name="product_barcode" string="Codigo de barras"/>
                         <field name="product_barcode" string="Codigo de barras"/>
-                        <field name="product_id" options='{"no_open": True}' string="Producto"/>
+                        <field name="product_id" options='{"no_open": True}' invisible="1" />
+                        <field name="product_name" options='{"no_open": True}' string="Producto" readonly="1"/>
                         <label for="product_qty" string="Cantidad"/>
                         <label for="product_qty" string="Cantidad"/>
                         <div>
                         <div>
                             <field name="product_qty" class="oe_inline"/>
                             <field name="product_qty" class="oe_inline"/>
-                            <field name="product_uom_id" options='{"no_open": True}' class="oe_inline"/>
+                            <field name="product_uom_id" options='{"no_open": True}' class="oe_inline" invisible="1"/>
                         </div>
                         </div>
                         <field name="type" invisible="1"/>
                         <field name="type" invisible="1"/>
                     </group>
                     </group>
                     <footer>
                     <footer>
                         <button name="save" type="object"
                         <button name="save" type="object"
                             class="oe_highlight" string="Guardar y Nuevo"/>
                             class="oe_highlight" string="Guardar y Nuevo"/>
-                            or
-                        <button special="cancel" string="Cancel" class="oe_link"/>
+                        <!--     or
+                        <button special="cancelar" string="Cancel" class="oe_link"/> -->
                     </footer>
                     </footer>
                 </form>
                 </form>
             </field>
             </field>