[FIX] account: prevent the residual amount of invoices/credit notes to be negative
bzr revid: qdp-launchpad@openerp.com-20130315130147-1n6g5z7nghmucibo
This commit is contained in:
parent
9485c49f4f
commit
9745c8c6c6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue