diff options
| author | Swapnesh Shah <swapneshshah111@gmail.com> | 2021-05-02 19:52:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-02 19:52:53 +0000 |
| commit | 4de0ae434d1adc97fc1077b8d0f23c7e800ec161 (patch) | |
| tree | c3937b7ed9f38bfe741e87c1d9396d4eccf0212c | |
| parent | 0490828de135406675b8c6949cf31cdccd697b02 (diff) | |
[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#70218
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
| -rw-r--r-- | addons/mrp/models/mrp_production.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index a2527e56214..30e147487d7 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1659,7 +1659,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, |
