[FIX] mrp: remove onchange in import hack

Since d7716f071d, the onchanges to create the stock moves in mrp
production have been replaced by computes.
There was a hack in the create() method to trigger the onchanges in case
of import. As those onchanges do not exist anymore, this hack needs to
be remove too.
The compute methods are called naturally in imports.

closes odoo/odoo#99434

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
This commit is contained in:
William Henrotin
2022-09-01 19:17:36 +02:00
parent f922f51910
commit 2c91ad3ae8
+1 -7
View File
@@ -820,13 +820,7 @@ class MrpProduction(models.Model):
if not vals.get('procurement_group_id'):
procurement_group_vals = self._prepare_procurement_group_vals(vals)
vals['procurement_group_id'] = self.env["procurement.group"].create(procurement_group_vals).id
productions = super().create(vals_list)
for production in productions:
# Trigger move_raw creation when importing a file
if 'import_file' in self.env.context:
production._onchange_move_raw()
production._onchange_move_finished()
return productions
return super().create(vals_list)
def unlink(self):
self.action_cancel()