From 480182a68d4bac88eea048f7327d3de55dad9c25 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Fri, 3 Sep 2010 17:00:43 +0200 Subject: [PATCH] [FIX] account: secondary currency on account.account may also accept invoices in company currency bzr revid: qdp-launchpad@tinyerp.com-20100903150043-vfptw2f9dgsoqcf4 --- addons/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index e0377512efc..02538dc2ac2 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -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: