[FIX] account: secondary currency on account.account may also accept invoices in company currency

bzr revid: qdp-launchpad@tinyerp.com-20100903150043-vfptw2f9dgsoqcf4
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-09-03 17:00:43 +02:00
parent e3ba2e2206
commit 480182a68d
1 changed files with 2 additions and 2 deletions

View File

@ -1350,8 +1350,8 @@ class account_move(osv.osv):
if not company_id == line.account_id.company_id.id:
raise osv.except_osv(_('Error'), _("Couldn't create move between different companies"))
if line.account_id.currency_id:
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
if line.account_id.currency_id and line.currency_id:
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
if abs(amount) < 10 ** -4: