-
-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OU-IMP] event_booth_sale: finish migration
- Loading branch information
1 parent
d3cb0b6
commit 665a3c8
Showing
3 changed files
with
31 additions
and
3 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
28 changes: 28 additions & 0 deletions
28
openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/post-migration.py
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,28 @@ | ||
# Copyright 2025 ForgeFlow S.L. (http://www.forgeflow.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
def fill_related_stored_fields(env): | ||
openupgrade.logged_query( | ||
env.cr, | ||
"""UPDATE event_booth eb | ||
SET price = ebc.price | ||
FROM event_booth_category ebc | ||
WHERE eb.booth_category_id = ebc.id | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
"""UPDATE event_type_booth etb | ||
SET price = ebc.price | ||
FROM event_booth_category ebc | ||
WHERE etb.booth_category_id = ebc.id | ||
""", | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
fill_related_stored_fields(env) |
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