From 4012e6f4c9f84d7cc793b73dff1a023828251cf5 Mon Sep 17 00:00:00 2001 From: "admin.suherdy" Date: Wed, 19 Nov 2025 15:57:33 +0700 Subject: [PATCH] first commit --- README.md | 75 +++++++++++++++ __init__.py | 1 + __manifest__.py | 26 ++++++ __pycache__/__init__.cpython-310.pyc | Bin 0 -> 223 bytes models/__init__.py | 62 +++++++++++++ models/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 2265 bytes .../account_payment.cpython-310.pyc | Bin 0 -> 2379 bytes models/account_payment.py | 86 ++++++++++++++++++ views/account_payment_views.xml | 41 +++++++++ 9 files changed, 291 insertions(+) create mode 100644 README.md create mode 100644 __init__.py create mode 100644 __manifest__.py create mode 100644 __pycache__/__init__.cpython-310.pyc create mode 100644 models/__init__.py create mode 100644 models/__pycache__/__init__.cpython-310.pyc create mode 100644 models/__pycache__/account_payment.cpython-310.pyc create mode 100644 models/account_payment.py create mode 100644 views/account_payment_views.xml diff --git a/README.md b/README.md new file mode 100644 index 0000000..9968bc3 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# 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 + +## How It Works + +The module extends the `account.payment` model with a computed field that: + +1. Retrieves the journal entry lines created by the payment +2. Identifies the counterpart lines (receivable/payable accounts) and write-off lines +3. Sums up their `amount_residual` or `amount_residual_currency` values +4. Displays the total unreconciled amount + +## Fields Added + +### `payment_residual` +- **Type**: Monetary (computed) +- **Currency**: Payment currency +- **Purpose**: Shows the residual amount not yet reconciled +- **Computation**: Based on `move_id.line_ids.amount_residual` and `amount_residual_currency` + +### `payment_residual_currency` +- **Type**: Monetary (computed) +- **Currency**: Payment currency +- **Purpose**: Shows the residual amount in the payment's currency + +## Usage + +### In List View +1. Go to **Accounting → Customers → Payments** (or **Vendors → Payments**) +2. Click the column selector (☰ icon) +3. Enable the "Residual" column +4. You'll see the unreconciled amount for each payment + +### In Form View +1. Open any customer or vendor payment +2. The "Residual Amount" field appears after the payment amount +3. Shows 0.00 for fully reconciled payments +4. Shows the remaining amount for partially reconciled payments + +## Technical Details + +### Dependencies +- `account` - Core Accounting module + +### Inheritance +- Extends: `account.payment` +- Views inherited: + - `account.view_account_payment_tree` + - `account.view_account_payment_form` + +### Computation Logic +The residual is computed using the same approach as Odoo's built-in `is_reconciled` field: +- Uses `_seek_for_lines()` to identify counterpart and write-off lines +- Filters for reconcilable accounts +- Sums the `amount_residual` or `amount_residual_currency` based on currency matching +- This ensures consistency with Odoo's core reconciliation logic + +## Installation + +1. Copy the module to your Odoo addons directory +2. Update the apps list +3. Install "Payment Residual Display" +4. No additional configuration needed + +## Author + +Created for Odoo 17 accounting workflow enhancement. \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..9a7e03e --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..1b26d5c --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,26 @@ +{ + 'name': 'Payment Residual Display', + 'version': '17.0.1.0.0', + 'category': 'Accounting', + 'summary': 'Display residual amounts in customer payment lines', + 'description': """ + This module adds residual amount display to customer payments. + + Features: + - Shows residual amount in payment list view + - Shows residual amount in payment form view + - Computes residual from journal items automatically + - Helps identify partially reconciled payments + + See README.md for more details. + """, + 'author': 'Suherdy Yacob', + 'depends': ['account'], + 'data': [ + 'views/account_payment_views.xml', + ], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} \ No newline at end of file diff --git a/__pycache__/__init__.cpython-310.pyc b/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eaed0f6c08706e63714d81cb810ce51179730cf9 GIT binary patch literal 223 zcmY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WzVB<+rD2> L_9oeIyEp#@DhiFc literal 0 HcmV?d00001 diff --git a/models/__pycache__/account_payment.cpython-310.pyc b/models/__pycache__/account_payment.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19b022f9f03a7f5af1e200b9a3d5e5cde9cf6427 GIT binary patch literal 2379 zcma)8Pj4eN6d%vOOwuF`D_B|;q>;Gna7eU(gjiNpQ4w(2YQ^pWMM5KY>^4(o#;NTT zCL{-x9^n%pr0s#jeic4~ublV_yAtAg{-sTez$3r$dw%cvz2~1j!+O1r0d4Q6cjIri z4dYMETyHio2hhb32r&psj1-MgYL3m+8e6G7wvq9rK}=#@8pNX3nX|ISF0r2(f%6yG z7=f)UJdKrm64QhT<))0#L?{$Sdir{60doLd908%m7!hM^5;V4`edg#Th)o>glGZQI z*ezsUA!}E%7WH1VNr!Ba?v+J)qdZ@d>(Q}%==Q{{1r3CogvzPlN!e^`Yxe{VCE zIBUYFz0UoVT~LU8n8cZWi(wgHlixh}FO9Hqws%W)onC}sE9(XTGd$>r(8Y6@Ss0%i z-~PTt3v_0PK7n_L3TmF4T6ShFO=&O87qI(RXoZ$m#aRVsFRZ1ru$L}q0OW{sX|jo&~+k4p_$v(YI1-SA9W zfOK#E>tTsnz#s*vm0+%+dBR!R0OE|zc!m={mNXR|ziQ3k3&wp(g#>Iq^2LOG@8cxd z^e8}ZiaANB5E}UP=EqpZEc1oLa<=w;T7yAtZ$M7%YzP{J-2jmWlMd`wzEDAvvAPP)fm;n}oN;u#VjW6(V zLe(2djF00ambt#(v?wt70E|_)j$h_e%I|@wC|gP1((HX8pFl4X=^95tTeYfdKn*sl zqjonX&DJWfzJZh_W+{9f@N`Ov@=oGJQVt^v9}8ur_=jLy*@7k~$^vhy4M+^Ntx$c* zBu<*EOTB%QU$1o!d~=4Q$-}ks-fh`6gBn1(IMr&6lMn82vX-r#^uUQO@TUETci69G zYx_=wGZGUF2T`@54&en(W^{8y^tW?IZ^&0bJkLe?F_CBWtv<3H8|gPZ1$CWrUQ_$k zpxre)s0+`UcC0S4|Cm4czxX@~wv-o!8BS>!s!kZfL6||!Le&k!bNH54GhP^HaOPsk zEr?TjPgq7J<~iR3mcOHk#<6M + + + + account.payment.tree.inherit + account.payment + + + + + + + + + + + + + account.payment.form.inherit + account.payment + + + + + + + + + \ No newline at end of file