diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 17135ed1f76..b4705245268 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -99,6 +99,8 @@ class account_invoice(osv.osv): for m in invoice.move_id.line_id: if m.account_id.type in ('receivable','payable'): result[invoice.id] += m.amount_residual_currency + #prevent the residual amount on the invoice to be less than 0 + result[invoice.id] = max(result[invoice.id], 0.0) return result # Give Journal Items related to the payment reconciled to this invoice