Skip to content

Commit

Permalink
Merge pull request #4421 from Tecnativa/16.0-ou_imp-account-zero_qty
Browse files Browse the repository at this point in the history
[16.0][OU-IMP] account: Set quantity = 0.00 on tax and payment_term amls
  • Loading branch information
pedrobaeza committed May 1, 2024
2 parents 90f2997 + b39bb86 commit 56adccb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions openupgrade_scripts/scripts/account/16.0.1.2/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ def _account_move_fast_fill_display_type(env):
WHERE aml.id = sub.id;
""",
)
# Extra actions: set quantity = 0 for lines of type tax or payment_term according
# https://github.com/odoo/odoo/blob/666229a0046e2d0e8331115e0247ad41734fb6e3/
# addons/account/tests/test_account_move_out_invoice.py#L69
# and
# https://github.com/odoo/odoo/blob/666229a0046e2d0e8331115e0247ad41734fb6e3/
# addons/account/tests/test_account_move_out_invoice.py#L107
openupgrade.logged_query(
env.cr,
"UPDATE account_move_line SET quantity = 0.00 "
"WHERE display_type IN ('tax', 'payment_term') "
"AND quantity IS DISTINCT FROM 0",
)


def _account_move_auto_post_boolean_to_selection(env):
Expand Down

0 comments on commit 56adccb

Please sign in to comment.