Fix invoice create with payment term without payment lines

bzr revid: ced-f08ff8dc25fc0cff830027668a0575546b76c951
This commit is contained in:
ced
2007-10-05 13:30:59 +00:00
parent 18809d4016
commit fbbb656988
+6 -2
View File
@@ -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