-
-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2265 from ForgeFlow/13.0-mig-calendar-script
[13.0][MIG] calendar
- Loading branch information
Showing
5 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
addons/calendar/migrations/13.0.1.0/openupgrade_analysis_work.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2020 ForgeFlow <http://www.forgeflow.com> | ||
# 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2020 ForgeFlow <http://www.forgeflow.com> | ||
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters