From 52ea71087c4de573ba72c7f5cb7e28f6e972a467 Mon Sep 17 00:00:00 2001 From: tranngocson1996 Date: Thu, 13 Jan 2022 14:07:23 +0700 Subject: [PATCH] [MIG] website_livechat: migration script --- docsource/modules130-140.rst | 2 +- .../website_livechat/14.0.1.0/post-migration.py | 9 +++++++++ .../website_livechat/14.0.1.0/pre-migration.py | 11 +++++++++++ .../14.0.1.0/upgrade_analysis_work.txt | 16 ++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/website_livechat/14.0.1.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/website_livechat/14.0.1.0/pre-migration.py create mode 100644 openupgrade_scripts/scripts/website_livechat/14.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules130-140.rst b/docsource/modules130-140.rst index 60666719a40d..aee5e63a7e3d 100644 --- a/docsource/modules130-140.rst +++ b/docsource/modules130-140.rst @@ -738,7 +738,7 @@ Module coverage 13.0 -> 14.0 +--------------------------------------------+-------------------------------------------------+ |website_links | | +--------------------------------------------+-------------------------------------------------+ -|website_livechat | | +|website_livechat | Done | +--------------------------------------------+-------------------------------------------------+ |website_mail | | +--------------------------------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/website_livechat/14.0.1.0/post-migration.py b/openupgrade_scripts/scripts/website_livechat/14.0.1.0/post-migration.py new file mode 100644 index 000000000000..e75ffb0ab2c3 --- /dev/null +++ b/openupgrade_scripts/scripts/website_livechat/14.0.1.0/post-migration.py @@ -0,0 +1,9 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.delete_records_safely_by_xml_id( + env, + ["website_livechat.menu_livechat"], + ) diff --git a/openupgrade_scripts/scripts/website_livechat/14.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/website_livechat/14.0.1.0/pre-migration.py new file mode 100644 index 000000000000..aa2615072f7c --- /dev/null +++ b/openupgrade_scripts/scripts/website_livechat/14.0.1.0/pre-migration.py @@ -0,0 +1,11 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.set_xml_ids_noupdate_value( + env, + "website_livechat", + ["im_livechat_channel_rule_public"], + True, + ) diff --git a/openupgrade_scripts/scripts/website_livechat/14.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_livechat/14.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..05baa93606ae --- /dev/null +++ b/openupgrade_scripts/scripts/website_livechat/14.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,16 @@ +---Models in module 'website_livechat'--- +---Fields in module 'website_livechat'--- +website_livechat / mail.channel / livechat_active (boolean) : module is now 'im_livechat' ('website_livechat') +# NOTHING TO DO: the website_livechat module depends on im_livechat module + +---XML records in module 'website_livechat'--- +ir.rule: website_livechat.im_livechat_channel_rule_public (noupdate) (noupdate switched) +# DONE: pre-migration: noupdate changed to "1" + + +NEW ir.ui.view: website_livechat.assets_tests +NEW ir.ui.view: website_livechat.qunit_suite +# NOTHING TO DO + +DEL website.menu: website_livechat.menu_livechat (noupdate) +# DONE: post-migration: safely deleted xmlid