fix: target actual bank.rec.widget (OWL) instead of legacy reconciliation widget — implement rest_debit/rest_credit fields + template extension
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
|
||||
## Overview
|
||||
|
||||
`dlv_account_reconciliation_rest_amount` extends the standard bank
|
||||
reconciliation screen (Accounting → Reconciliation) so the still-open
|
||||
("rest") amount of a line is shown in parentheses next to its total.
|
||||
`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 a proposed line (the bank movement itself,
|
||||
or an added invoice/bill) is only partially used to close the statement line,
|
||||
Odoo shows the full amount struck through and the partial amount used above
|
||||
it — but not what remains unmatched on that line. This addon adds that
|
||||
missing number, e.g.:
|
||||
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
|
||||
@@ -22,19 +22,27 @@ outstanding, without having to search for it elsewhere.
|
||||
|
||||
## How it works
|
||||
|
||||
- `static/src/js/reconciliation_rest_amount.js` patches
|
||||
`account.ReconciliationRenderer`'s `ManualLineRenderer.update()`. Before
|
||||
every render, it walks `state.reconciliation_proposition` and, for any line
|
||||
where `partial_amount` differs from `amount`, computes and formats the
|
||||
difference as `line.rest_amount_str`.
|
||||
- `static/src/xml/reconciliation_rest_amount.xml` inherits the shared
|
||||
`reconciliation.line.mv_line.amount` template (from `account_accountant`)
|
||||
via xpath and prints `line.rest_amount_str` between parentheses, right
|
||||
after the existing amount.
|
||||
- `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.
|
||||
|
||||
Because both the bank movement (liquidity line) and any added invoice/bill
|
||||
proposition are rendered through the same loop and template, this single
|
||||
patch covers both cases.
|
||||
### 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
|
||||
|
||||
@@ -42,5 +50,6 @@ patch covers both cases.
|
||||
|
||||
## Installation
|
||||
|
||||
Standard addon install/update. No configuration or data is added; the change
|
||||
is purely visual on the existing reconciliation widget.
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user