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
6 changes: 4 additions & 2 deletions openupgradelib/openupgrade_130.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ def convert_old_style_tax_tag_to_new(
UPDATE account_account_tag_account_move_line_rel r
SET account_account_tag_id = %s
FROM account_move_line aml
LEFT JOIN account_move am ON am.id = aml.account_id
WHERE
r.account_move_line_id = aml.id AND
aml.debit >= 0 AND
am.type IN ('out_invoice', 'in_invoice') AND
r.account_account_tag_id = %s
""",
(new_debit_tag_id, old_tag_id),
Expand All @@ -114,9 +115,10 @@ def convert_old_style_tax_tag_to_new(
UPDATE account_account_tag_account_move_line_rel r
SET account_account_tag_id = %s
FROM account_move_line aml
LEFT JOIN account_move am ON am.id = aml.account_id
WHERE
r.account_move_line_id = aml.id AND
aml.credit > 0 AND
am.type IN ('out_refund', 'in_refund') AND
r.account_account_tag_id = %s
""",
(new_credit_tag_id, old_tag_id),
Expand Down
Loading