diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-06-19 14:39:54 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-06-22 08:56:12 +0000 |
| commit | 4658f8f0aff231b7ca9429f4fe0017a061a5cd5a (patch) | |
| tree | a9a49c5fbfe67031d44e336b199914dbf44399a6 | |
| parent | ec1b3a11addcc24c6fe6685c76bf7c077e782da8 (diff) | |
[FIX] mrp: unbuild with lot
- Create 3 products:
A: kg, no tracking
B: kg, tracked by lot
AB: kg, no tracking
- Create a BOM for AB:
1 kg of A
30 g of B
- Create a MO for 1 kg of AB, validate and close the MO
- Unbuild the MO
A stock move for 0.03 g of B is created instead of 30 g.
This happens because we wrongly compare the quantity in the UoM of the
stock move with a normalied quantity.
opw-2278727
closes odoo/odoo#53390
X-original-commit: 6790e89f97d6bbbaab4e071af52cce9ccee98821
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | addons/mrp/models/mrp_unbuild.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mrp/models/mrp_unbuild.py b/addons/mrp/models/mrp_unbuild.py index 6d345e75763..03eb22dbf00 100644 --- a/addons/mrp/models/mrp_unbuild.py +++ b/addons/mrp/models/mrp_unbuild.py @@ -181,7 +181,7 @@ class MrpUnbuild(models.Model): if move.has_tracking != 'none': original_move = move in produce_moves and self.mo_id.move_raw_ids or self.mo_id.move_finished_ids original_move = original_move.filtered(lambda m: m.product_id == move.product_id) - needed_quantity = move.product_qty + needed_quantity = move.product_uom_qty moves_lines = original_move.mapped('move_line_ids') if move in produce_moves and self.lot_id: moves_lines = moves_lines.filtered(lambda ml: self.lot_id in ml.produce_line_ids.lot_id) # FIXME sle: double check with arm |
