Skip to content
Open
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
14 changes: 14 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 @@ -771,6 +771,19 @@ def fill_account_move_line_amounts(env):
)


def fill_account_move_line_amount_residual_currency(env):
openupgrade.logged_query(
env.cr,
"""
UPDATE account_move_line aml
SET amount_residual_currency = aml.amount_residual
WHERE aml.company_currency_id = aml.currency_id
AND aml.amount_residual != 0
AND (aml.amount_residual_currency = 0
OR aml.amount_residual_currency IS NULL);""",
)


def fill_account_move_line_date(env):
openupgrade.logged_query(
env.cr,
Expand Down Expand Up @@ -859,6 +872,7 @@ def migrate(env, version):
pass_payment_to_journal_entry_narration(env)
fill_company_account_cash_basis_base_account_id(env)
fill_account_move_line_amounts(env)
fill_account_move_line_amount_residual_currency(env)
fill_account_move_line_date(env)
openupgrade.load_data(env.cr, "account", "14.0.1.1/noupdate_changes.xml")
try_delete_noupdate_records(env)
Expand Down