[MERGE] OPW 579553: account: fix traceback when modifing existing journal entry line

bzr revid: xal@openerp.com-20121009095814-stushuzy29g2hgha
This commit is contained in:
Xavier ALT
2012-10-09 11:58:14 +02:00
+2 -2
View File
@@ -1367,9 +1367,9 @@ class account_move(osv.osv):
def onchange_line_id(self, cr, uid, ids, line_ids, context=None):
balance = 0.0
line_ids = self.resolve_o2m_commands_to_record_dicts(cr, uid, 'line_id', line_ids, context=context)
for line in line_ids:
if line[2]:
balance += (line[2]['debit'] or 0.00)- (line[2]['credit'] or 0.00)
balance += (line['debit'] or 0.00)- (line['credit'] or 0.00)
return {'value': {'balance': balance}}
def write(self, cr, uid, ids, vals, context=None):