[FIX]hr_expense :improve fource journal if fource journal have currency convert the expense to that currency

bzr revid: mma@tinyerp.com-20120814054348-6ofe8r0fcksbhp85
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-08-14 11:13:48 +05:30
parent 52eb6fd1dd
commit 25367f13bb
1 changed files with 5 additions and 0 deletions

View File

@ -162,6 +162,11 @@ class hr_expense_expense(osv.osv):
total_amount = line.total_amount
if exp.journal_id:
journal = exp.journal_id
if journal.currency:
if exp.currency_id != journal.currency:
total_amount = currency_obj.compute(cr, uid, exp.currency_id.id, journal.currency.id, line.total_amount, context=ctx)
else:
total_amount = line.total_amount
else:
journal_id = voucher_obj._get_journal(cr, uid, context={'type': 'purchase', 'company_id': company_id})
if journal_id: