[FIX] use correct currency_id for is_zero

bzr revid: al@openerp.com-20111013223958-p24b36eno5ljfey1
This commit is contained in:
Antony Lesuisse 2011-10-14 00:39:58 +02:00
parent 6fe4f45ed0
commit 0c0881e17f
1 changed files with 5 additions and 2 deletions

View File

@ -741,7 +741,10 @@ class account_move_line(osv.osv):
company_list.append(line.company_id.id)
for line in self.browse(cr, uid, ids, context=context):
company_currency_id = line.company_id.currency_id
if line.account_id.currency_id:
currency_id = line.account_id.currency_id
else:
currency_id = line.company_id.currency_id
if line.reconcile_id:
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
if line.reconcile_partial_id:
@ -760,7 +763,7 @@ class account_move_line(osv.osv):
total += line.amount_currency
else:
total += (line.debit or 0.0) - (line.credit or 0.0)
if self.pool.get('res.currency').is_zero(cr, uid, company_currency_id, total):
if self.pool.get('res.currency').is_zero(cr, uid, currency_id, total):
res = self.reconcile(cr, uid, merges+unmerge, context=context, writeoff_acc_id=writeoff_acc_id, writeoff_period_id=writeoff_period_id, writeoff_journal_id=writeoff_journal_id)
return res
r_id = move_rec_obj.create(cr, uid, {