[FIX] mrp: set default product on unbuild order
Before this commit, Creating Unbuild order using Unbuild Button was resetting Bom as it was calling `_onchange_product_id` after setting `mo_id` which was resetting Bom on Unbuild order. To Fix Issue, We setting `default_product_id` so It would not reset `bom_id` when `_onchange_product_id` is called. Fixes: #70216 Odoo Ticket: 2521788 closes odoo/odoo#70304 X-original-commit: 4de0ae434d1adc97fc1077b8d0f23c7e800ec161 Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
This commit is contained in:
@@ -1622,7 +1622,8 @@ class MrpProduction(models.Model):
|
||||
'res_model': 'mrp.unbuild',
|
||||
'view_id': self.env.ref('mrp.mrp_unbuild_form_view_simplified').id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'context': {'default_mo_id': self.id,
|
||||
'context': {'default_product_id': self.product_id.id,
|
||||
'default_mo_id': self.id,
|
||||
'default_company_id': self.company_id.id,
|
||||
'default_location_id': self.location_dest_id.id,
|
||||
'default_location_dest_id': self.location_src_id.id,
|
||||
|
||||
Reference in New Issue
Block a user