[FIX] account: display correct price_unit with 100% taxes

Currently, when modifying an invoice line and setting taxes
(price included) for 100%, the price_unit field will
be displayed as 0.

This is incorrect and is being fixed here.

opw-2793284

closes odoo/odoo#88180

X-original-commit: 674eaa3bc10210d34a02145529516da1fa1c1b66
Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
John Laterre (jol)
2022-04-07 09:46:51 +02:00
parent 227c5d13dc
commit ee5687a04e
+3 -2
View File
@@ -3894,8 +3894,9 @@ class AccountMoveLine(models.Model):
'discount': 0.0,
'price_unit': amount_currency / (quantity or 1.0),
}
elif not discount_factor:
# balance of line is 0, but discount == 100% so we display the normal unit_price
elif not discount_factor or not amount_currency:
# balance of line is 0, but discount == 100% or taxes (price included) == 100%,
# so we display the normal unit_price
vals = {}
else:
# balance is 0, so unit price is 0 as well