Skip to content

Commit

Permalink
[FIX] account: fill missing ref (memo) to move of payment
Browse files Browse the repository at this point in the history
  • Loading branch information
ndd-odoo authored and royle-vietnam committed Jan 29, 2024
1 parent 3bb0d4b commit fe9ead2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions openupgrade_scripts/scripts/account/14.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,18 @@ def pass_payment_to_journal_entry_narration(env):
)


def fill_ref_of_payment_move(env):
openupgrade.logged_query(
env.cr,
"""
UPDATE account_move am
SET ref = ap.communication
FROM account_payment ap
WHERE ap.move_id = am.id AND char_length(COALESCE(ap.communication, '')) > 0
""",
)


def fill_company_account_cash_basis_base_account_id(env):
openupgrade.logged_query(
env.cr,
Expand Down Expand Up @@ -882,3 +894,4 @@ def migrate(env, version):
_migrate_currency_exchange_account_company(env)
_create_ir_config_parameter_constraint_start_date(env)
_switch_default_account_and_outstanding_account(env)
fill_ref_of_payment_move(env)

0 comments on commit fe9ead2

Please sign in to comment.