[FIX] account: add missing constrains dependencies
Create a move line having: amount_currency = 1000 debit = 0 credit = 1000 The error is raised, it's ok. Now, create a move line having: amount_currency = 1000 debit = 1000 credit = 0 Then save, edit and write: debit = 0 credit = 1000 No error raised, it's wrong! -opw 1818714
This commit is contained in:
@@ -444,7 +444,7 @@ class AccountMoveLine(models.Model):
|
||||
raise UserError(_("You cannot create journal items with a secondary currency without filling both 'currency' and 'amount currency' field."))
|
||||
|
||||
@api.multi
|
||||
@api.constrains('amount_currency')
|
||||
@api.constrains('amount_currency', 'debit', 'credit')
|
||||
def _check_currency_amount(self):
|
||||
for line in self:
|
||||
if line.amount_currency:
|
||||
|
||||
Reference in New Issue
Block a user