[MERGE] account: If the credit or debit field does not exist in the journal entry line, return 0.0

bzr revid: stw@openerp.com-20120905130038-3lk43b0ftzoscobm
This commit is contained in:
Stephane Wirtel 2012-09-05 15:00:38 +02:00
commit 2d89c39f89
1 changed files with 1 additions and 1 deletions

View File

@ -1375,7 +1375,7 @@ class account_move(osv.osv):
balance = 0.0
for line in line_ids:
if line[2]:
balance += (line[2]['debit'] or 0.00)- (line[2]['credit'] or 0.00)
balance += (line[2].get('debit',0.00)- (line[2].get('credit',0.00)))
return {'value': {'balance': balance}}
def write(self, cr, uid, ids, vals, context=None):