[FIX] Account: Bank statement line,if has write-off entries,should pass write off account to move line

bzr revid: jvo@tinyerp.com-20100125085256-jqxoqe1xlg8amx02
This commit is contained in:
Jay (Open ERP) 2010-01-25 14:22:56 +05:30
parent 1fa671cd45
commit db12e88f2b
1 changed files with 8 additions and 1 deletions

View File

@ -287,7 +287,14 @@ class account_bank_statement(osv.osv):
torec += map(lambda x: x.id, move.reconcile_id.line_ids)
#try:
if abs(move.reconcile_amount-move.amount)<0.0001:
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
writeoff_acc_id = False
#There should only be one write-off account!
for entry in move.reconcile_id.line_new_ids:
writeoff_acc_id = entry.account_id.id
break
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
else:
account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context)
#except: