Why do you cast bool for the first condition?
This condition leads to confusion especially when we have to deal with the precedence (+ has a higher precedence than 'not', while 'and' has a lower precedence than 'not').
Seems simpler to me:
if not (l.debit and l.credit):
continue
if bool(l.currency_id) != bool(l.amount_currency):
return False
Why do you cast bool for the first condition?
This condition leads to confusion especially when we have to deal with the precedence (+ has a higher precedence than 'not', while 'and' has a lower precedence than 'not').
Seems simpler to me:
if not (l.debit and l.credit): amount_ currency) :
continue
if bool(l.currency_id) != bool(l.
return False