From 9bc86c64a0e911dd2247a95799a49976113ebb46 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Thu, 16 Jul 2015 15:36:12 +0200 Subject: [PATCH] [FIX] prevent contraint trigger currency revaluation error on reconcile (Forward port of bug fix : 6c540d23de3e1f85f29d456e6f94dfa74d989de1 ) --- account_constraints/model/account_move_line.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_constraints/model/account_move_line.py b/account_constraints/model/account_move_line.py index 1e2f30cb2..78ed280f1 100644 --- a/account_constraints/model/account_move_line.py +++ b/account_constraints/model/account_move_line.py @@ -126,6 +126,9 @@ class AccountMoveLine(models.Model): @api.constrains('amount_currency') def _check_currency_amount(self): for l in self: + # 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)):