Files
odoo-cooltools/dlv_account_reconciliation_rest_amount/README.md
T
Kristof Bernaert c4b848ce0b dlv_account_reconciliation_rest_amount: rest op eigen regel + scope verduidelijkt
- Toon het restbedrag als "(rest: € ...)" op een eigen regel boven het
  ingezette bedrag i.p.v. inline ernaast.
- Manifest summary/description, README (nieuwe Scope-sectie) en CHANGELOG
  aangescherpt: addon dekt enkel gedeeltelijk afgepunte facturen; de
  bankbewegingsregel en het betalingsoverschot (open balance) zijn buiten
  scope.
2026-09-21 13:01:41 +02:00

72 lines
3.0 KiB
Markdown

# dlv_account_reconciliation_rest_amount
## Overview
`dlv_account_reconciliation_rest_amount` extends the bank reconciliation
widget (Accounting → Reconciliation, model `bank.rec.widget`) so the still
outstanding ("rest") amount of a partially matched line is shown in
parentheses next to its total.
On the reconciliation screen, when an added invoice/bill (a `new_aml` line)
is only partially used to close the statement line, Odoo shows the full
source amount struck through below the amount actually used — but not what
remains unmatched on that line. This addon adds that missing number, e.g.:
```
€ 1.899,97
€ 4.486,35 (€ 2.586,38)
```
so the user immediately sees that €2.586,38 of that invoice is still
outstanding, without having to search for it elsewhere.
## Scope
This addon covers exactly one case: an added invoice/bill line that is only
**partially** used to close the statement line (invoice amount > amount used).
The number shown is that invoice's residual / still-open amount
(`amount_residual`, "restbedrag / openstaand saldo").
Explicitly **out of scope**:
- The bank movement (liquidity) line — always reflects the full statement line
amount; there is no partial/rest concept for it (see note below).
- The opposite case, where the payment is *larger* than the matched invoice(s)
and the surplus is auto-posted to the suspense/waiting account as an "open
balance" line. That surplus is a property of the statement line, not of a
partially used invoice, so this addon does not annotate it.
## How it works
- `models/bank_rec_widget_line.py` inherits `bank.rec.widget.line` and adds
two computed `Monetary` fields, `rest_debit` and `rest_credit`
(`source_balance - balance`, split like the existing `debit`/`credit`
fields). Because `bank.rec.widget._compute_lines_widget` automatically
serializes every field of `bank.rec.widget.line` to the front-end, these
two fields become available client-side as `line.rest_debit` /
`line.rest_credit` (each with `.display`, `.value`, `.is_zero`) with no
extra plumbing needed.
- `static/src/xml/reconciliation_rest_amount.xml` extends the OWL template
`account_accountant.bank_rec_widget_form_lines_widget`
(`t-inherit-mode="extension"`) and prints the rest amount in parentheses
next to the struck-through source amount, when it is non-zero.
### Note on the bank movement itself
Earlier iterations of this addon assumed the bank movement (liquidity) line
could also show a "rest" amount, based on the legacy (pre-16.4) reconciliation
widget where that concept existed. In the `bank.rec.widget` model actually
used on this instance, the liquidity line always reflects the full statement
line amount — there is no partial/rest concept for it, so nothing is shown
there. See ROADMAP.md.
## Dependencies
- `account_accountant`
## Installation
Standard addon install/update (`-u dlv_account_reconciliation_rest_amount`).
No configuration or data is added; the change is a new computed field plus a
purely visual template extension on the existing reconciliation widget.