[IMP] mrp : usability for produce wizard
On the production wizard when you are using a product tracked by SN/lot and another not tracked as consumed element. You edit the form view by settings the correct quantity -> Use the produce wizard. It will display the tracked product (you can see the details you entered before) -> validate. It will double the quantity done for the not tracked product. This commit will change the wizard behavior by only set the quantity done on untracked product if it is not already set.
This commit is contained in:
@@ -82,7 +82,7 @@ class MrpProductProduce(models.TransientModel):
|
||||
quantity = self.product_qty
|
||||
if float_compare(quantity, 0, precision_rounding=self.product_uom_id.rounding) <= 0:
|
||||
raise UserError(_('You should at least produce some quantity'))
|
||||
for move in moves.filtered(lambda x: x.product_id.tracking == 'none' and x.state not in ('done', 'cancel')):
|
||||
for move in moves.filtered(lambda x: x.product_id.tracking == 'none' and x.quantity_done == 0 and x.state not in ('done', 'cancel')):
|
||||
if move.unit_factor:
|
||||
rounding = move.product_uom.rounding
|
||||
move.quantity_done += float_round(quantity * move.unit_factor, precision_rounding=rounding)
|
||||
|
||||
Reference in New Issue
Block a user