diff --git a/addons/calendar/migrations/13.0.1.0/noupdate_changes.xml b/addons/calendar/migrations/13.0.1.0/noupdate_changes.xml index cff73376dbfe..cb32f0ad59b2 100644 --- a/addons/calendar/migrations/13.0.1.0/noupdate_changes.xml +++ b/addons/calendar/migrations/13.0.1.0/noupdate_changes.xml @@ -2,38 +2,38 @@ Email - 3 Hours - - email + Email - 6 Hours - - email + Notification - 15 Minutes - - notification + Notification - 30 Minutes - - notification + Notification - 1 Hours - - notification + Notification - 2 Hours - - notification + Notification - 1 Days - - notification + ${(object.event_id.user_id.email_formatted or user.email_formatted or '') | safe} diff --git a/addons/calendar/migrations/13.0.1.0/openupgrade_analysis_work.txt b/addons/calendar/migrations/13.0.1.0/openupgrade_analysis_work.txt new file mode 100644 index 000000000000..6a05d6f88ad1 --- /dev/null +++ b/addons/calendar/migrations/13.0.1.0/openupgrade_analysis_work.txt @@ -0,0 +1,16 @@ +---Models in module 'calendar'--- +---Fields in module 'calendar'--- +calendar / calendar.alarm / alarm_type (selection) : NEW required, selection_keys: ['email', 'notification'], req_default: function, hasdefault +calendar / calendar.alarm / type (selection) : DEL required, selection_keys: ['email', 'notification'], req_default: function +# DONE: pre-migration: renamed fields + +calendar / calendar.event / event_tz (selection) : NEW selection_keys: function, hasdefault +# NOTHING TO DO: New field that has default, will be automatically filled + +calendar / mail.activity.type / category (False) : selection_keys is now '['default', 'meeting', 'upload_file']' ('['default', 'meeting']') +# NOTHING TO DO: new features + +---XML records in module 'calendar'--- +DEL ir.ui.view: calendar.mail_activity_type_view_form +DEL ir.ui.view: calendar.view_calendar_event_form_popup +# NOTHING TO DO diff --git a/addons/calendar/migrations/13.0.1.0/post-migration.py b/addons/calendar/migrations/13.0.1.0/post-migration.py new file mode 100644 index 000000000000..db6045191d86 --- /dev/null +++ b/addons/calendar/migrations/13.0.1.0/post-migration.py @@ -0,0 +1,20 @@ +# Copyright 2020 ForgeFlow +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +def _empty_calendar_event_tz(env): + """Make sure event tz is empty for equal behavior as in v12.""" + openupgrade.logged_query( + env.cr, + "UPDATE calendar_event set event_tz = NULL WHERE event_tz IS NOT NULL", + ) + + +@openupgrade.migrate() +def migrate(env, version): + _empty_calendar_event_tz(env) + openupgrade.load_data( + env.cr, 'calendar', 'migrations/13.0.1.0/noupdate_changes.xml') diff --git a/addons/calendar/migrations/13.0.1.0/pre-migration.py b/addons/calendar/migrations/13.0.1.0/pre-migration.py new file mode 100644 index 000000000000..628c3aced7fb --- /dev/null +++ b/addons/calendar/migrations/13.0.1.0/pre-migration.py @@ -0,0 +1,13 @@ +# Copyright 2020 ForgeFlow +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + +_field_renames = [ + ('calendar.alarm ', 'calendar_alarm ', 'type', 'alarm_type'), +] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.rename_fields(env, _field_renames) diff --git a/odoo/openupgrade/doc/source/modules120-130.rst b/odoo/openupgrade/doc/source/modules120-130.rst index 5de70367d795..67e84961d408 100644 --- a/odoo/openupgrade/doc/source/modules120-130.rst +++ b/odoo/openupgrade/doc/source/modules120-130.rst @@ -97,7 +97,7 @@ missing in the new release are marked with |del|. +----------------------------------------------+-------------------------------------------------+ |bus | Nothing to do | +----------------------------------------------+-------------------------------------------------+ -|calendar | | +|calendar | Done | +----------------------------------------------+-------------------------------------------------+ |calendar_sms | | +----------------------------------------------+-------------------------------------------------+