From fbbb656988bc25c9f90a37ca047514df1fab7447 Mon Sep 17 00:00:00 2001 From: ced <> Date: Fri, 5 Oct 2007 13:30:59 +0000 Subject: [PATCH] Fix invoice create with payment term without payment lines bzr revid: ced-f08ff8dc25fc0cff830027668a0575546b76c951 --- addons/account/invoice.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 3429cfe3035..b60940dd636 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -412,13 +412,17 @@ class account_invoice(osv.osv): acc_id = inv.account_id.id name = inv['name'] or '/' + totlines = False if inv.payment_term: - totlines = self.pool.get('account.payment.term').compute(cr, uid, inv.payment_term.id, total) + totlines = self.pool.get('account.payment.term').compute(cr, + uid, inv.payment_term.id, total) + if totlines: res_amount_currency = total_currency i = 0 for t in totlines: if inv.currency_id.id != company_currency: - amount_currency = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, t[1]) + amount_currency = cur_obj.compute(cr, uid, + company_currency, inv.currency_id.id, t[1]) else: amount_currency = False