Skip to content

Commit 2f10e41

Browse files
authored
Merge pull request #2381 from ForgeFlow/13.0-mig-website_event_track
[13.0][MIG] website_event_track
2 parents d292a41 + 946b12e commit 2f10e41

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---Models in module 'website_event_track'---
2+
---Fields in module 'website_event_track'---
3+
website_event_track / event.sponsor / image_128 (binary) : NEW attachment: True, isrelated: related, stored
4+
website_event_track / event.sponsor / image_medium (binary) : DEL attachment: True
5+
# DONE: pre-migration: renamed
6+
7+
website_event_track / event.track / date_end (datetime) : NEW isfunction: function, stored
8+
# NOTHING TO DO
9+
10+
website_event_track / event.track.tag / name (char) : now required
11+
# DONE: post-migration: assure is filled
12+
13+
---XML records in module 'website_event_track'---
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from openupgradelib import openupgrade
4+
5+
6+
def fill_event_track_tag_name(env):
7+
openupgrade.logged_query(
8+
env.cr, """
9+
UPDATE event_track_tag
10+
SET name = 'default_name_' || id
11+
WHERE name IS NULL""",
12+
)
13+
14+
15+
@openupgrade.migrate()
16+
def migrate(env, version):
17+
fill_event_track_tag_name(env)
18+
openupgrade.load_data(
19+
env.cr, "website_event_track",
20+
"migrations/13.0.1.0/noupdate_changes.xml")
21+
openupgrade.delete_record_translations(
22+
env.cr, 'website_event_track', [
23+
'mail_template_data_track_confirmation',
24+
],
25+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from openupgradelib import openupgrade
4+
5+
6+
def rename_image_attachments(env):
7+
for old, new in [("image_medium", "image_128")]:
8+
openupgrade.logged_query(
9+
env.cr, """
10+
UPDATE ir_attachment SET res_field = %s
11+
WHERE res_field = %s AND res_model = 'event.sponsor'""",
12+
(new, old),
13+
)
14+
15+
16+
@openupgrade.migrate()
17+
def migrate(env, version):
18+
rename_image_attachments(env)

odoo/openupgrade/doc/source/modules120-130.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ missing in the new release are marked with |del|.
675675
+----------------------------------------------+-------------------------------------------------+
676676
|website_event_sale | |
677677
+----------------------------------------------+-------------------------------------------------+
678-
|website_event_track | |
678+
|website_event_track | Done |
679679
+----------------------------------------------+-------------------------------------------------+
680680
|website_form | Done |
681681
+----------------------------------------------+-------------------------------------------------+

0 commit comments

Comments
 (0)