[FIX] account,point_of_sale: Fix 'fixed' price-included tax with negative quantity

closes odoo/odoo#73324

Ticket: 2585188
X-original-commit: 1417a34c6e3dc6f2826e605ad60de1030c80b186
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
Laurent Smet
2021-07-06 15:19:06 +00:00
parent 6597b8c971
commit 0a2ec2f6d5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -502,7 +502,7 @@ class AccountTax(models.Model):
elif tax.amount_type == 'division':
incl_division_amount += tax.amount * sum_repartition_factor
elif tax.amount_type == 'fixed':
incl_fixed_amount += quantity * tax.amount * sum_repartition_factor
incl_fixed_amount += abs(quantity) * tax.amount * sum_repartition_factor
else:
# tax.amount_type == other (python)
tax_amount = tax._compute_amount(base, sign * price_unit, quantity, product, partner) * sum_repartition_factor
+1 -1
View File
@@ -2182,7 +2182,7 @@ exports.Orderline = Backbone.Model.extend({
else if(tax.amount_type === 'division')
incl_division_amount += tax.amount;
else if(tax.amount_type === 'fixed')
incl_fixed_amount += quantity * tax.amount
incl_fixed_amount += Math.abs(quantity) * tax.amount
else{
var tax_amount = self._compute_all(tax, base, quantity);
incl_fixed_amount += tax_amount;