|
@@ -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):
|