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
This commit is contained in:
@@ -166,6 +166,9 @@ class AccountMoveLine(orm.Model):
|
|||||||
|
|
||||||
def _check_currency_amount(self, cr, uid, ids, context=None):
|
def _check_currency_amount(self, cr, uid, ids, context=None):
|
||||||
for l in self.browse(cr, uid, ids, context=context):
|
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:
|
||||||
if ((l.amount_currency > 0.0 and l.credit > 0.0) or
|
if ((l.amount_currency > 0.0 and l.credit > 0.0) or
|
||||||
(l.amount_currency < 0.0 and l.debit > 0.0)):
|
(l.amount_currency < 0.0 and l.debit > 0.0)):
|
||||||
|
|||||||
Reference in New Issue
Block a user