Port sale_order_add_bom to v10

This commit is contained in:
Alexis de Lattre
2016-11-15 11:36:34 +01:00
parent d331dee3ba
commit feb39edd22

View File

@@ -28,8 +28,7 @@ class SaleAddPhantomBom(models.TransientModel):
@api.model @api.model
def _prepare_sale_order_line(self, bom_line, sale_order, wizard_qty): def _prepare_sale_order_line(self, bom_line, sale_order, wizard_qty):
qty_in_product_uom = self.env['product.uom']._compute_qty_obj( qty_in_product_uom = bom_line.product_uom_id._compute_quantity(
bom_line.product_uom,
bom_line.product_qty, bom_line.product_qty,
bom_line.product_id.uom_id) bom_line.product_id.uom_id)
vals = { vals = {
@@ -56,10 +55,6 @@ class SaleAddPhantomBom(models.TransientModel):
for line in self.bom_id.bom_line_ids: for line in self.bom_id.bom_line_ids:
if float_is_zero(line.product_qty, precision_digits=prec): if float_is_zero(line.product_qty, precision_digits=prec):
continue continue
if line.date_start and line.date_start > today:
continue
if line.date_stop and line.date_stop < today:
continue
# The onchange is played in the inherit of the create() # The onchange is played in the inherit of the create()
# of sale order line in the 'sale' module # of sale order line in the 'sale' module
# TODO: if needed, we could increment existing order lines # TODO: if needed, we could increment existing order lines