[FIX] account: sign of a fixed amount tax

The sign of a fixed amount tax must be the same as the base amount.
Inspired from the computation of a percent tax.

opw:682407
This commit is contained in:
Goffin Simon
2016-07-18 09:39:06 +02:00
parent 9df6f6d576
commit fbca56111b
+1 -1
View File
@@ -613,7 +613,7 @@ class AccountTax(models.Model):
"""
self.ensure_one()
if self.amount_type == 'fixed':
return math.copysign(self.amount, base_amount) * quantity
return math.copysign(self.amount, base_amount) * abs(quantity)
if (self.amount_type == 'percent' and not self.price_include) or (self.amount_type == 'division' and self.price_include):
return base_amount * self.amount / 100
if self.amount_type == 'percent' and self.price_include: