8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 01:16:27 +00:00

Do not fail on empty discount

This commit is contained in:
Hugo LEVY-FALK 2018-12-29 23:55:18 +01:00 committed by chirac
parent f612e4192f
commit b85384b226

View file

@ -133,7 +133,7 @@ class DiscountForm(Form):
amount = discount/100 * invoice_price amount = discount/100 * invoice_price
else: else:
amount = discount amount = discount
if amount > 0: if amount:
name = _("{}% discount") if is_relative else _("{}€ discount") name = _("{}% discount") if is_relative else _("{}€ discount")
name = name.format(discount) name = name.format(discount)
Vente.objects.create( Vente.objects.create(