Skip to content

Commit

Permalink
[FIX] payment: The field authorized_transaction_ids is moved from `…
Browse files Browse the repository at this point in the history
…payment` to `account_payment`,

need to install the `account_payment` module to avoid errors.
  • Loading branch information
anhbtit committed Jun 20, 2024
1 parent 6e3b349 commit 0d1780e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/payment/16.0.2.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ def fill_payment_provider_is_published(env):
)


def _force_install_account_payment(env):
# Because the field `authorized_transaction_ids` is moved from `payment` to `account_payment`,
# we need to install the `account_payment` module to avoid errors.
openupgrade.logged_query(
env.cr,
"""
UPDATE ir_module_module
SET state = 'to install'
WHERE name = 'account_payment' AND state = 'uninstalled'
"""
)


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env.cr, "payment", "16.0.2.0/noupdate_changes.xml")
fill_payment_provider_is_published(env)
_force_install_account_payment(env)

0 comments on commit 0d1780e

Please sign in to comment.