[FIX] check move_line_id before writing to it, otherwise we get bool != integer

This commit is contained in:
Vincent Vinet
2014-08-08 09:50:21 -04:00
committed by Sandy Carter
parent c362272242
commit 6b706666ac

View File

@@ -99,10 +99,11 @@ class bank_acc_rec_statement(osv.osv):
statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids
for statement_line in statement_lines:
#Mark the move lines as 'Cleared'mand assign the 'Bank Acc Rec Statement ID'
account_move_line_obj.write(cr, uid, [statement_line.move_line_id.id],
{'cleared_bank_account': statement_line.cleared_bank_account,
'bank_acc_rec_statement_id': statement_line.cleared_bank_account and statement.id or False
}, context=context)
if statement_line.move_line_id:
account_move_line_obj.write(cr, uid, [statement_line.move_line_id.id],
{'cleared_bank_account': statement_line.cleared_bank_account,
'bank_acc_rec_statement_id': statement_line.cleared_bank_account and statement.id or False
}, context=context)
self.write(cr, uid, [statement.id], {'state': 'done',
'verified_by_user_id': uid,