mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] prevent contraint trigger currency revaluation error on reconcile (Forward port of bug fix : 6c540d23de )
This commit is contained in:
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user