Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX][14.0] account: fill amount residual currency on account move line #146

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
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