3.2 KiB
Executable File
3.2 KiB
Executable File
Payment Residual Display
This module adds residual amount display to customer and vendor payments in Odoo 17.
Features
- Residual Amount Field: Shows the unreconciled amount remaining on each payment
- List View Integration: Adds "Residual" column to payment list views (hidden by default)
- Form View Integration: Displays residual amount in payment form view
- Multi-Currency Support: Handles both company currency and payment currency residuals
- Aggregation Support: Enables "sum" aggregation in list views and when grouping by any field (e.g., Partner, Journal)
How It Works
The module extends the account.payment model with a computed field that:
- Retrieves the journal entry lines created by the payment
- Identifies only the counterpart lines (receivable/payable accounts)
- Excludes liquidity account lines (bank/cash) to avoid false residuals when matched with bank statements
- Sums up their
amount_residualoramount_residual_currencyvalues based on currency - Displays the total unreconciled amount
Fields Added
payment_residual
- Type: Monetary (computed, stored)
- Currency: Payment currency
- Purpose: Shows the residual amount not yet reconciled
- Aggregation: Supports "sum" operator for totals and grouping
- Computation: Based on
move_id.line_ids.amount_residualandamount_residual_currency
payment_residual_currency
- Type: Monetary (computed, stored)
- Currency: Payment currency
- Purpose: Shows the residual amount in the payment's currency
- Aggregation: Supports "sum" operator
Usage
In List View
- Go to Accounting → Customers → Payments (or Vendors → Payments)
- Click the column selector (☰ icon)
- Enable the "Residual" column
- You'll see the unreconciled amount for each payment
In Form View
- Open any customer or vendor payment
- The "Residual Amount" field appears after the payment amount
- Shows 0.00 for fully reconciled payments
- Shows the remaining amount for partially reconciled payments
Grouping and Aggregation
- In the payment list view, use the Group By filter (e.g., by Partner or Journal)
- The group headers will display the total sum of the residual amounts for each group
- The bottom of the list view displays the total residual for all visible records
Technical Details
Dependencies
account- Core Accounting module
Inheritance
- Extends:
account.payment - Views inherited:
account.view_account_payment_treeaccount.view_account_payment_form
Computation Logic
The residual is computed by:
- Filtering only receivable/payable account lines (excludes liquidity accounts)
- This prevents showing residuals when payments are matched with bank statements
- Sums the
amount_residualoramount_residual_currencybased on payment currency - Uses company currency residual for same-currency payments
- Uses foreign currency residual for multi-currency payments
- This ensures accurate residual display regardless of bank statement matching
Installation
- Copy the module to your Odoo addons directory
- Update the apps list
- Install "Payment Residual Display"
- No additional configuration needed
Author
Created for Odoo 17 accounting workflow enhancement.