diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index dc2f31e7c6f8..97882aad76d8 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -62,8 +62,6 @@ "l10n_es_irnr_sii": "l10n_es_aeat_sii_oca", # OCA/maintenance "base_maintenance_config": "maintenance", - "maintenance_plan": "maintenance", - "maintenance_plan_activity": "maintenance", "maintenance_plan_employee": "maintenance", # OCA/product-attribute "product_catalog": "product", diff --git a/openupgrade_scripts/scripts/maintenance/17.0.1.0/post-migration.py b/openupgrade_scripts/scripts/maintenance/17.0.1.0/post-migration.py index 014cf04cacc4..31d865530b0a 100644 --- a/openupgrade_scripts/scripts/maintenance/17.0.1.0/post-migration.py +++ b/openupgrade_scripts/scripts/maintenance/17.0.1.0/post-migration.py @@ -5,29 +5,6 @@ _deleted_xml_records = ["maintenance.mail_alias_equipment"] -def _maintenance_plan(env): - """Compatibility with maintenance_plan, we convert the request and - the recurrence field the way it is done in core. - """ - if openupgrade.column_exists(env.cr, "maintenance_request", "maintenance_plan_id"): - # Update all the data of the linked requests - openupgrade.logged_query( - env.cr, - """UPDATE maintenance_request mr - SET recurring_maintenance = True, - repeat_interval = COALESCE(mp.interval, 1), - repeat_unit = COALESCE(mp.interval_step, 'year'), - repeat_type='until', - repeat_until = ( - CURRENT_DATE + ('' - || COALESCE(mp.maintenance_plan_horizon, 1) || ' ' - || COALESCE(mp.planning_step, 'year'))::interval - )::date - FROM maintenance_plan mp - WHERE mr.maintenance_plan_id = mp.id""", - ) - - @openupgrade.migrate() def migrate(env, version): openupgrade.load_data(env, "maintenance", "17.0.1.0/noupdate_changes.xml") @@ -35,4 +12,3 @@ def migrate(env, version): env, _deleted_xml_records, ) - _maintenance_plan(env) diff --git a/openupgrade_scripts/scripts/maintenance/17.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/maintenance/17.0.1.0/pre-migration.py index 326d342d46a4..62e98936a2b6 100644 --- a/openupgrade_scripts/scripts/maintenance/17.0.1.0/pre-migration.py +++ b/openupgrade_scripts/scripts/maintenance/17.0.1.0/pre-migration.py @@ -3,22 +3,6 @@ from openupgradelib import openupgrade -def _maintenance_plan(env): - """Rename the fields if the maintenance_plan module was installed.""" - if openupgrade.column_exists(env.cr, "maintenance_request", "note"): - openupgrade.rename_fields( - env, - [ - ( - "maintenance.request", - "maintenance_request", - "note", - "instruction_text", - ), - ], - ) - - def _maintenance_request_company_id(env): """We set the company_id value for requests that do not have it. We get the value of what will be deductively most appropriate (equipment, team or @@ -50,4 +34,3 @@ def _maintenance_request_company_id(env): @openupgrade.migrate() def migrate(env, version): _maintenance_request_company_id(env) - _maintenance_plan(env)