Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---Models in module 'website_event_track'---
---Fields in module 'website_event_track'---
website_event_track / event.sponsor / image_128 (binary) : NEW attachment: True, isrelated: related, stored
website_event_track / event.sponsor / image_medium (binary) : DEL attachment: True
# DONE: pre-migration: renamed

website_event_track / event.track / date_end (datetime) : NEW isfunction: function, stored
# NOTHING TO DO

website_event_track / event.track.tag / name (char) : now required
# DONE: post-migration: assure is filled

---XML records in module 'website_event_track'---
25 changes: 25 additions & 0 deletions addons/website_event_track/migrations/13.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def fill_event_track_tag_name(env):
openupgrade.logged_query(
env.cr, """
UPDATE event_track_tag
SET name = 'default_name_' || id
WHERE name IS NULL""",
)


@openupgrade.migrate()
def migrate(env, version):
fill_event_track_tag_name(env)
openupgrade.load_data(
env.cr, "website_event_track",
"migrations/13.0.1.0/noupdate_changes.xml")
openupgrade.delete_record_translations(
env.cr, 'website_event_track', [
'mail_template_data_track_confirmation',
],
)
18 changes: 18 additions & 0 deletions addons/website_event_track/migrations/13.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def rename_image_attachments(env):
for old, new in [("image_medium", "image_128")]:
openupgrade.logged_query(
env.cr, """
UPDATE ir_attachment SET res_field = %s
WHERE res_field = %s AND res_model = 'event.sponsor'""",
(new, old),
)


@openupgrade.migrate()
def migrate(env, version):
rename_image_attachments(env)
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules120-130.rst
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ missing in the new release are marked with |del|.
+----------------------------------------------+-------------------------------------------------+
|website_event_sale | |
+----------------------------------------------+-------------------------------------------------+
|website_event_track | |
|website_event_track | Done |
+----------------------------------------------+-------------------------------------------------+
|website_form | Done |
+----------------------------------------------+-------------------------------------------------+
Expand Down