-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code is renamed ref in v16 but there is also a code in the same table in v16 this code prevent an openupgrade failing because of already existing column (code)
- Loading branch information
Showing
3 changed files
with
33 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
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,27 @@ | ||
# Copyright 2024 Akretion France (http://www.akretion.com/) | ||
# @author: Raphaël Reverdy <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if not openupgrade.column_exists(env.cr, "payment_acquirer", "ref"): | ||
# in v16 | ||
# payment_acquirer is renamed payment_provider | ||
# and there is another different "code" field on payment_provider | ||
# in sale_import_base (v16) the code field is now ref | ||
# but without migration script | ||
# therefore, we change it here to be future proof. | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"payment.aquirer", | ||
"payment_acquirer", | ||
"code", | ||
"ref", | ||
), | ||
], | ||
) |
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