From f4567e4b6bb6aab0082f1bc0ac4502efb5c30b68 Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Tue, 29 Jun 2021 14:48:39 +0000 Subject: [PATCH] [FIX] mrp: keep operations at uninstallation The commit 1355c9694ef481df083460464c27af6fef5ca06d archive all mrp operations at "Work Order" setting unticking. The good way would be to hide the operations if the setting is deactivate. closes odoo/odoo#72985 X-original-commit: 58d42aea296ac9ff548542a3120c6e81bbd61d02 Signed-off-by: Arnold Moyaux --- addons/mrp/models/res_config_settings.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/mrp/models/res_config_settings.py b/addons/mrp/models/res_config_settings.py index 4ddaeecd528..ca11ff63370 100644 --- a/addons/mrp/models/res_config_settings.py +++ b/addons/mrp/models/res_config_settings.py @@ -34,10 +34,7 @@ class ResConfigSettings(models.TransientModel): # Work Orders' is deactivated. # Long story short: if 'mrp_workorder' is already installed, we don't uninstall it based on # group_mrp_routings - operations = self.env['mrp.routing.workcenter'].with_context({'active_test': False}).search([('company_id', '=', self.company_id.id)]) if self.group_mrp_routings: self.module_mrp_workorder = True else: - operations.action_archive() # When deactivating workorders we want to archive all the operations linked to the company - if not self.env['ir.module.module'].search([('name', '=', 'mrp_workorder'), ('state', '=', 'installed')]): - self.module_mrp_workorder = False + self.module_mrp_workorder = False