[FIX] account: Negative fixed taxes on 100% discount

This commit fix a previous fix : https://github.com/odoo/odoo/pull/62244

opw-23789781~[FIX] account: Negative fixed taxes on 100% discount

closes odoo/odoo#63349

X-original-commit: da6b1667ab3566a88765f38f812df6a20c0abb03
Signed-off-by: tdetry (det-odoo) <tdetry@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
Thomas (det)
2020-12-14 16:13:00 +00:00
parent addd40a09f
commit d0efcd8538
+2 -1
View File
@@ -3339,7 +3339,8 @@ class AccountMoveLine(models.Model):
# 220 | 10% incl, 5% | | 200 | 230
# 20 | | 10% incl | 20 | 20
# 10 | | 5% | 10 | 10
taxes_res = taxes._origin.with_context(force_sign=self.move_id._get_tax_force_sign()).compute_all(amount_currency, currency=currency, handle_price_include=False)
force_sign = -1 if move_type in ('out_invoice', 'in_refund', 'out_receipt') else 1
taxes_res = taxes._origin.with_context(force_sign=force_sign).compute_all(amount_currency, currency=currency, handle_price_include=False)
for tax_res in taxes_res['taxes']:
tax = self.env['account.tax'].browse(tax_res['id'])
if tax.price_include: