From 35e333822df9e29713a967d13c609341e97ffbbd Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Thu, 23 Mar 2023 15:15:41 +0000 Subject: [PATCH] [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#116433 X-original-commit: a70f804d7da68d5cc7cdd79b75d73359c41b9367 Signed-off-by: Olivier Colson (oco) Signed-off-by: Laurent Smet --- addons/account/models/account_tax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_tax.py b/addons/account/models/account_tax.py index 7c0df6c991f..5ae7aa5a483 100644 --- a/addons/account/models/account_tax.py +++ b/addons/account/models/account_tax.py @@ -420,7 +420,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, include_caba_tags=include_caba_tags)