[FIX] mrp: default UoM when registering lot

- Create a products A
- Create a products B
  Tracked by lot
  UoM: kg
- Get some quantity in stock for B
- Create a BOM for A: 2g of B to produce A
- Create a MO for A, Produce

In the lot registration wizard, 2kg of B are suggested instead of 2g of
B.

In this case, the UoM of the product is taken instead of the move.
However, it should only be the case if the product is tracked by unique
S/N.

opw-2200263

closes odoo/odoo#47019

X-original-commit: 9d114eb7a48b82b76e9c900cce22dc5022206367
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-03-05 16:07:34 +00:00
parent 3c4c625a0a
commit 4ca24a47de
+1 -1
View File
@@ -174,7 +174,7 @@ class MrpAbstractWorkorder(models.AbstractModel):
serial number.
"""
lines = []
is_tracked = move.product_id.tracking != 'none'
is_tracked = move.product_id.tracking == 'serial'
if move in self.move_raw_ids._origin:
# Get the inverse_name (many2one on line) of raw_workorder_line_ids
initial_line_values = {self.raw_workorder_line_ids._get_raw_workorder_inverse_name(): self.id}