diff --git a/invoice.py b/invoice.py index db850eebe5..1e2d799c74 100644 --- a/invoice.py +++ b/invoice.py @@ -1336,9 +1336,11 @@ class InvoiceLine(OSV): vals['_parent_invoice.currency'], context=context) else: currency = vals['_parent_invoice.currency'] - return currency_obj.round(cursor, user, currency, - Decimal(str(vals.get('quantity') or '0.0')) * \ - (vals.get('unit_price') or Decimal('0.0'))) + amount = Decimal(str(vals.get('quantity') or '0.0')) * \ + (vals.get('unit_price') or Decimal('0.0')) + if currency: + return currency_obj.round(cursor, user, currency, amount) + return amount return Decimal('0.0') def on_change_with_unit_digits(self, cursor, user, ids, vals,