From e03a87ae08ab24190f2ed023db24b59fa8bf4b11 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 18 May 2020 14:09:26 +0000 Subject: [PATCH] [FIX] repair: Unable to end repair Steps to reproduce the bug: - Create a repair order RO for a product P1 - Create a part for a product P2 that needs a lot L - Specify a source location for P2 - Process RO - Click on 'END REPAIR' Bug: A UserError was raised saying: You need to supply a Lot/Serial number for product P2 even if a lot L was set to P2 opw:2251047 closes odoo/odoo#51797 X-original-commit: 1e3ed56332efd3f58ccd05f23c6af9cb23f1052f Signed-off-by: Simon Goffin (sig) --- addons/repair/models/repair.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/repair/models/repair.py b/addons/repair/models/repair.py index ed642164b07..1f956c6da77 100644 --- a/addons/repair/models/repair.py +++ b/addons/repair/models/repair.py @@ -546,6 +546,9 @@ class Repair(models.Model): # quant is created in operation.location_id. move._set_quantity_done(operation.product_uom_qty) + if operation.lot_id: + move.move_line_ids.lot_id = operation.lot_id + moves |= move operation.write({'move_id': move.id, 'state': 'done'}) move = Move.create({