[FIX] mrp: Context irrelevant of hidden parameters for stock_mrp
Step to reproduce: - Inventory > Configuration > Operations Types > Manufacturing (or any other operation type with code 'mrp_operation') - Change 'Type of Operation' to 'Receipt' (or any other but 'manufacturing') - Uncheck box field 'Use Existing Lots/Serial Numbers' - Change 'Type of Operation' back to 'Manufacturing' - Set correct value for 'Default Source Location' (type Receipt changed the value to 'Vendor', need to fix it) - Create a storable product with the route 'Manufacture' selected. - Create a BoM for this product, with a component tracked by lot (Add quantity to component) - Create a MO for the product > Confirm > Check Availability Current Behaviour : Quantity are reserved, but the lot_ids are not visible The behaviour is due to the fact that hidden parameters still have effect when they should act as their default value. To ensure it's the case, they are set back to their original value when the user switch between configuration to avoid ending in a wrongful configuration. Behaviour after PR : Lot ids are shown no matter the hidden configuration of picking type opw-2680370 closes odoo/odoo#82377 X-original-commit: 22bbf43eba0927bdf27218da16f8435b33756112 Signed-off-by: Arnold Moyaux <arm@odoo.com> Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
This commit is contained in:
@@ -50,6 +50,12 @@ class StockPickingType(models.Model):
|
||||
def get_mrp_stock_picking_action_picking_type(self):
|
||||
return self._get_action('mrp.mrp_production_action_picking_deshboard')
|
||||
|
||||
@api.onchange('code')
|
||||
def _onchange_code(self):
|
||||
if self.code == 'mrp_operation':
|
||||
self.use_create_lots = True
|
||||
self.use_existing_lots = True
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user