From ef158c5f36a4a2cdf607252c7dae2ac58027e5ba Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Tue, 9 Nov 2021 13:50:12 +0000 Subject: [PATCH] [FIX] mrp: set component's lot as readonly in MO Updating the producing quantity may wrongly change the consumed quantity of tracked products To reproduce the issue: 1. Create two storable products P1, P2: - P2 is tracked by lots 2. Update P2's quantity >= 10 3. Create a BoM: - Product: P1 - Components: 1 x P2 4. Create and confirm a MO for 10 x P1 5. Check availability 6. Edit the MO and set the consumed quantity of P2 to 10 7. Edit the MO and set the producing quantity to 8 Error: The consumed quantity of P2 becomes 1 When saving the MO, it also writes the `lot_ids` on `move_raw_ids` while it shouldn't. As a result, it triggers method `_set_lot_ids` for no reason and lead to an undesirable behavior. OPW-2667412 closes odoo/odoo#79757 X-original-commit: 66a1e96f88b3b06f40f9fd8035fca61d4e2a4e3a Signed-off-by: William Henrotin (whe) Signed-off-by: Adrien Widart --- addons/mrp/views/mrp_production_views.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml index 1c22111dac3..07cd34eeef5 100644 --- a/addons/mrp/views/mrp_production_views.xml +++ b/addons/mrp/views/mrp_production_views.xml @@ -313,7 +313,9 @@