[FIX] use correct currency_id for is_zero
bzr revid: al@openerp.com-20111013223958-p24b36eno5ljfey1
This commit is contained in:
parent
6fe4f45ed0
commit
0c0881e17f
|
@ -741,7 +741,10 @@ class account_move_line(osv.osv):
|
||||||
company_list.append(line.company_id.id)
|
company_list.append(line.company_id.id)
|
||||||
|
|
||||||
for line in self.browse(cr, uid, ids, context=context):
|
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:
|
if line.reconcile_id:
|
||||||
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
|
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
|
||||||
if line.reconcile_partial_id:
|
if line.reconcile_partial_id:
|
||||||
|
@ -760,7 +763,7 @@ class account_move_line(osv.osv):
|
||||||
total += line.amount_currency
|
total += line.amount_currency
|
||||||
else:
|
else:
|
||||||
total += (line.debit or 0.0) - (line.credit or 0.0)
|
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)
|
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
|
return res
|
||||||
r_id = move_rec_obj.create(cr, uid, {
|
r_id = move_rec_obj.create(cr, uid, {
|
||||||
|
|
Loading…
Reference in New Issue