File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,9 +101,10 @@ def convert_old_style_tax_tag_to_new(
101101 UPDATE account_account_tag_account_move_line_rel r
102102 SET account_account_tag_id = %s
103103 FROM account_move_line aml
104+ LEFT JOIN account_move am ON am.id = aml.account_id
104105 WHERE
105106 r.account_move_line_id = aml.id AND
106- aml.debit >= 0 AND
107+ am.type IN ('out_invoice', 'in_invoice') AND
107108 r.account_account_tag_id = %s
108109 """ ,
109110 (new_debit_tag_id , old_tag_id ),
@@ -114,9 +115,10 @@ def convert_old_style_tax_tag_to_new(
114115 UPDATE account_account_tag_account_move_line_rel r
115116 SET account_account_tag_id = %s
116117 FROM account_move_line aml
118+ LEFT JOIN account_move am ON am.id = aml.account_id
117119 WHERE
118120 r.account_move_line_id = aml.id AND
119- aml.credit > 0 AND
121+ am.type IN ('out_refund', 'in_refund') AND
120122 r.account_account_tag_id = %s
121123 """ ,
122124 (new_credit_tag_id , old_tag_id ),
You can’t perform that action at this time.
0 commit comments