Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions addons/payment/migrations/12.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,25 @@ def fill_invoice_ids(env):
env['payment.transaction'].search([])._compute_invoice_ids_nbr()


def fill_missing_acquirers_journals(env):
"""There's a new check in sale.order._create_payment_transaction() method
that avoids to create the payment transaction (although is not needed at
all), so we prevent the problem creating/assigning the missing journals
in payment acquirers through the helper that the core offers.
"""
companies = env["res.company"].search([])
Acquirer = env["payment.acquirer"]
for company in companies:
Acquirer._create_missing_journal_for_acquirers(company=company)


@openupgrade.migrate()
def migrate(env, version):
cr = env.cr
map_payment_transaction_state(cr)
fill_payment_transaction_is_processed(cr)
fill_payment_transaction_payment_id(cr)
fill_invoice_ids(env)
fill_missing_acquirers_journals(env)
openupgrade.load_data(
cr, 'payment', 'migrations/12.0.1.0/noupdate_changes.xml')