Skip to content
Snippets Groups Projects
Commit a70f804d authored by Laurent Smet's avatar Laurent Smet
Browse files

[FIX] account: Fix is_refund for manual reconciliation widget


Create an misc journal entry with 1000 as debit and a tax.
The tax line is linked to a refund tax repartition line.

Open the manual reconciliation widget and do the same.
The tax line is linked to an invoice tax repartition line.

When dealing with tax grids, the resulting tags set on the journal items are not the same.
This is because the given price_unit is not following the sign of the debit/credit column.
Indeed, a positive amount means you are adding something on the credit column.

opw-3236208

closes odoo/odoo#116387

Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
parent b57c1332
No related branches found
No related tags found
No related merge requests found
......@@ -301,7 +301,7 @@ class AccountTax(models.Model):
# We first need to find out whether this tax computation is made for a refund
tax_type = self and self[0].type_tax_use
is_refund = is_refund or (tax_type == 'sale' and price_unit < 0) or (tax_type == 'purchase' and price_unit > 0)
is_refund = is_refund or (tax_type == 'sale' and price_unit > 0) or (tax_type == 'purchase' and price_unit < 0)
rslt = self.with_context(caba_no_transition_account=True)\
.compute_all(price_unit, currency=currency_id, quantity=quantity, product=product_id, partner=partner_id, is_refund=is_refund)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment