diff options
| author | Goffin Simon <sig@odoo.com> | 2020-05-18 14:09:26 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2020-05-25 11:12:17 +0000 |
| commit | e03a87ae08ab24190f2ed023db24b59fa8bf4b11 (patch) | |
| tree | 42845e929dda1623835807f9093dfbff1388fddf | |
| parent | 45f3659305359fff5b0c7bf3de7d49a25ba5c36d (diff) | |
[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) <sig@openerp.com>
| -rw-r--r-- | addons/repair/models/repair.py | 3 |
1 files changed, 3 insertions, 0 deletions
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({ |
