diff --git a/dlv_account_reconciliation_rest_amount/models/bank_rec_widget_line.py b/dlv_account_reconciliation_rest_amount/models/bank_rec_widget_line.py index f009758..5436e56 100644 --- a/dlv_account_reconciliation_rest_amount/models/bank_rec_widget_line.py +++ b/dlv_account_reconciliation_rest_amount/models/bank_rec_widget_line.py @@ -23,9 +23,17 @@ class BankRecWidgetLine(models.Model): compute="_compute_dlv_rest_amount", ) - @api.depends("balance", "source_balance") + @api.depends("balance", "source_balance", "flag") def _compute_dlv_rest_amount(self): + # Enkel voor 'new_aml'-regels heeft source_balance een betekenisvolle + # waarde t.o.v. balance (zie _compute_display_stroked_balance in + # bank_rec_widget_line.py van account_accountant). Voor andere + # regels (o.a. de liquidity-regel) staat source_balance gewoon op 0, + # wat zonder deze check een fout restbedrag zou opleveren. for line in self: - rest = line.source_balance - line.balance + if line.flag == "new_aml": + rest = line.source_balance - line.balance + else: + rest = 0.0 line.rest_debit = rest if rest > 0.0 else 0.0 line.rest_credit = -rest if rest < 0.0 else 0.0 diff --git a/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml b/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml index 43340ae..118d1d9 100644 --- a/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml +++ b/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml @@ -3,9 +3,11 @@ - - () + + + + () + - - () + + + + () +