summaryrefslogtreecommitdiff
path: root/addons/mrp/wizard
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-07-16 16:02:41 +0200
committerMartin Trigaux <mat@odoo.com>2019-07-16 16:36:40 +0200
commitbeba36416fdf25df74cf8a581c66948a418173b6 (patch)
treed24b8a373560afcc78bde4c9c06338800809abfa /addons/mrp/wizard
parent044904b9d50d61c5c7e5432a1b4615dda145704c (diff)
parent40421be73c94551ba902856984c0155d062cb449 (diff)
[MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c94551b
Diffstat (limited to 'addons/mrp/wizard')
-rw-r--r--addons/mrp/wizard/change_production_qty.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index 41f8d429517..5d933ee00f8 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -60,15 +60,22 @@ class ChangeProductionQty(models.TransientModel):
if line.child_bom_id and line.child_bom_id.type == 'phantom' or\
line.product_id.type not in ['product', 'consu']:
continue
- move, old_qty, new_qty = production._update_raw_move(line, line_data)
+ move = production.move_raw_ids.filtered(lambda x: x.bom_line_id.id == line.id and x.state not in ('done', 'cancel'))
+ if move:
+ old_qty = move[0].product_uom_qty
+ else:
+ old_qty = 0
iterate_key = production._get_document_iterate_key(move)
if iterate_key:
- document = self.env['stock.picking']._log_activity_get_documents({move: (new_qty, old_qty)}, iterate_key, 'UP')
+ document = self.env['stock.picking']._log_activity_get_documents({move: (line_data['qty'], old_qty)}, iterate_key, 'UP')
for key, value in document.items():
if documents.get(key):
documents[key] += [value]
else:
documents[key] = [value]
+
+ production._update_raw_move(line, line_data)
+
production._log_manufacture_exception(documents)
operation_bom_qty = {}
for bom, bom_data in boms: