From 6c540d23de3e1f85f29d456e6f94dfa74d989de1 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Fri, 6 Mar 2015 16:33:13 +0100 Subject: [PATCH] [FIX] prevent contraint trigger currency revaluation error on reconcile --- account_constraints/account_constraints.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_constraints/account_constraints.py b/account_constraints/account_constraints.py index 09203a432..490d64838 100644 --- a/account_constraints/account_constraints.py +++ b/account_constraints/account_constraints.py @@ -166,6 +166,9 @@ class AccountMoveLine(orm.Model): def _check_currency_amount(self, cr, uid, ids, context=None): for l in self.browse(cr, uid, ids, context=context): + # If account have a second currency, don't apply constraint + if l.account_id.currency_id: + continue if l.amount_currency: if ((l.amount_currency > 0.0 and l.credit > 0.0) or (l.amount_currency < 0.0 and l.debit > 0.0)):