Skip to content

Commit

Permalink
[FIX] account,point_of_sale: Fix 'fixed' price-included tax with nega…
Browse files Browse the repository at this point in the history
…tive quantity

closes odoo#73324

Ticket: 2585188
X-original-commit: 1417a34
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
  • Loading branch information
smetl committed Jul 6, 2021
1 parent 6597b8c commit 0a2ec2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/account/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def recompute_base(base_amount, fixed_amount, percent_amount, division_amount):
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
Expand Down
2 changes: 1 addition & 1 deletion addons/point_of_sale/static/src/js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a2ec2f

Please sign in to comment.