Skip to content

Commit

Permalink
Merge pull request #1388 from ForgeFlow/account_banking_sepa_credit_t…
Browse files Browse the repository at this point in the history
…ransfer-add-migration-script

[15.0][FIX] account_banking_sepa_credit_transfer: add migration script
  • Loading branch information
pedrobaeza authored Dec 19, 2024
2 parents 87a2308 + 09d8811 commit 4888747
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from openupgradelib import openupgrade


def _create_account_payment_method_line(env):
# Create account payment method lines from account payment methods
openupgrade.logged_query(
env.cr,
"""
INSERT INTO account_payment_method_line (name, sequence,
payment_method_id, journal_id, create_uid, write_uid,
create_date, write_date)
SELECT apm.name, 10, apm.id, aj.id,
apm.create_uid, apm.write_uid, apm.create_date, apm.write_date
FROM account_payment_method apm, account_journal aj
WHERE apm.code = 'sepa_credit_transfer' AND aj.type IN ('bank', 'cash')
""",
)


@openupgrade.migrate()
def migrate(env, version):
_create_account_payment_method_line(env)

0 comments on commit 4888747

Please sign in to comment.