diff --git a/README.md b/README.md index a065f50..46e0180 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,56 @@ -# Account Reconciliation Reference - -## Overview -This Odoo module enhances the bank reconciliation interface by displaying and managing reference information more effectively. It adds visibility and functionality for the 'ref' field across various reconciliation views and operations. - -## Features - -### Bank Reconciliation Views -- **Kanban Cards**: Shows the 'ref' field on bank reconciliation kanban cards for `account.bank.statement.line` records -- **List View**: Adds 'ref' column to bank reconciliation list view, making it visible by default -- **Search Functionality**: Includes 'ref' field in the bank reconciliation search, allowing users to filter by reference - -### Journal Items Reconciliation -- Displays 'ref' field in Journal Items Reconcile list view for better visibility of reference information - -### Manual Operations Panel -- Shows reference field in the Manual Operations panel for non-liquidity lines -- Makes the reference field editable for liquidity lines in the reconciliation form -- Persists the reference value to both the journal entry (`move.ref`) and statement line (`st_line.ref`) when entered - -### Data Persistence -- When a reference is entered in Manual Operations, it's saved to both the journal entry reference and the statement line reference -- Reference values are maintained after validation and reconciliation operations -- Reference data is preserved when clicking Validate in reconciliation interface - -## Technical Implementation - -### Models -- Extends `bank.rec.widget` model to handle reference field persistence -- Implements `_line_value_changed_ref()` method to persist reference values to both journal entry and statement line -- Overrides `_action_validate()` method to ensure reference values are saved before reconciliation - -### Views -- Extends kanban view for `account.bank.statement.line` to display reference -- Modifies tree view for `account.bank.statement.line` to show reference column by default -- Updates search view for `account.bank.statement.line` to include reference in search -- Extends reconciliation tree view for `account.move.line` to show reference field -- Custom XML template extends the manual operations panel in reconciliation form - -## Usage - -1. Navigate to the bank reconciliation interface -2. References will now be visible in kanban cards and list views -3. Use the search functionality to filter by reference -4. In Manual Operations panel, you can view and edit references for liquidity lines -5. When entering a reference and validating, it will be persisted to both the journal entry and statement line - -## Dependencies -- `account_accountant` - Core accounting module with reconciliation features - -## Compatibility -- Odoo Version: 17.0 -- Module Version: 17.0.1.0.2 - -## License +# Account Reconciliation Reference + +## Overview +This Odoo module enhances the bank reconciliation interface by displaying and managing reference information more effectively. It adds visibility and functionality for the 'ref' field across various reconciliation views and operations. + +## Features + +### Bank Reconciliation Views +- **Kanban Cards**: Shows the 'ref' field on bank reconciliation kanban cards for `account.bank.statement.line` records +- **List View**: Adds 'ref' column to bank reconciliation list view, making it visible by default +- **Search Functionality**: Includes 'ref' field in the bank reconciliation search, allowing users to filter by reference + +### Journal Items Reconciliation +- Displays 'ref' field in Journal Items Reconcile list view for better visibility of reference information + +### Manual Operations Panel +- Shows reference field in the Manual Operations panel for non-liquidity lines +- Makes the reference field editable for liquidity lines in the reconciliation form +- Persists the reference value to both the journal entry (`move.ref`) and statement line (`st_line.ref`) when entered + +### Data Persistence +- When a reference is entered in Manual Operations, it's saved to both the journal entry reference and the statement line reference +- Reference values are maintained after validation and reconciliation operations +- Reference data is preserved when clicking Validate in reconciliation interface + +## Technical Implementation + +### Models +- Extends `bank.rec.widget` model to handle reference field persistence +- Implements `_line_value_changed_ref()` method to persist reference values to both journal entry and statement line +- Overrides `_action_validate()` method to ensure reference values are saved before reconciliation + +### Views +- Extends kanban view for `account.bank.statement.line` to display reference +- Modifies tree view for `account.bank.statement.line` to show reference column by default +- Updates search view for `account.bank.statement.line` to include reference in search +- Extends reconciliation tree view for `account.move.line` to show reference field +- Custom XML template extends the manual operations panel in reconciliation form + +## Usage + +1. Navigate to the bank reconciliation interface +2. References will now be visible in kanban cards and list views +3. Use the search functionality to filter by reference +4. In Manual Operations panel, you can view and edit references for liquidity lines +5. When entering a reference and validating, it will be persisted to both the journal entry and statement line + +## Dependencies +- `account_accountant` - Core accounting module with reconciliation features + +## Compatibility +- Odoo Version: 17.0 +- Module Version: 17.0.1.0.2 + +## License LGPL-3 \ No newline at end of file diff --git a/__init__.py b/__init__.py index a6ffc5f..e90f752 100644 --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,3 @@ -# -*- coding: utf-8 -*- -# Account Reconciliation Reference addon +# -*- coding: utf-8 -*- +# Account Reconciliation Reference addon from . import models \ No newline at end of file diff --git a/__manifest__.py b/__manifest__.py index cd9760c..fce6818 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,31 +1,31 @@ -# -*- coding: utf-8 -*- -{ - 'name': 'Account Reconciliation Reference', - 'version': '17.0.1.0.2', - 'category': 'Accounting/Accounting', - 'summary': 'Show Reference on reconciliation kanban/list and add to search', - 'description': """ -Show Reference on reconciliation UI -- Adds 'ref' on bank reconciliation kanban cards (account.bank.statement.line) -- Shows 'ref' column in bank reconciliation list view -- Adds 'ref' field in bank reconciliation search -- Also shows 'ref' in Journal Items Reconcile list -- Shows 'ref' on Manual Operations panel and persists it on Validate -""", - 'author': 'Your Company', - 'website': 'https://example.com', - 'license': 'LGPL-3', - 'depends': ['account_accountant'], - 'data': [ - 'views/account_reconcile_views.xml', - 'views/bank_rec_widget_views.xml', - ], - 'assets': { - 'web.assets_backend': [ - 'account_reconcile_reference/static/src/xml/bank_rec_form_inherit.xml', - ], - }, - 'installable': True, - 'auto_install': False, - 'application': False, +# -*- coding: utf-8 -*- +{ + 'name': 'Account Reconciliation Reference', + 'version': '17.0.1.0.2', + 'category': 'Accounting/Accounting', + 'summary': 'Show Reference on reconciliation kanban/list and add to search', + 'description': """ +Show Reference on reconciliation UI +- Adds 'ref' on bank reconciliation kanban cards (account.bank.statement.line) +- Shows 'ref' column in bank reconciliation list view +- Adds 'ref' field in bank reconciliation search +- Also shows 'ref' in Journal Items Reconcile list +- Shows 'ref' on Manual Operations panel and persists it on Validate +""", + 'author': 'Suherdy Yacob', + 'website': 'https://example.com', + 'license': 'LGPL-3', + 'depends': ['account_accountant'], + 'data': [ + 'views/account_reconcile_views.xml', + 'views/bank_rec_widget_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'account_reconcile_reference/static/src/xml/bank_rec_form_inherit.xml', + ], + }, + '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 0000000..883e8ec Binary files /dev/null and b/__pycache__/__init__.cpython-310.pyc differ diff --git a/models/__init__.py b/models/__init__.py index 3e9d119..72761ca 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,2 +1,2 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- from . import bank_rec_widget \ No newline at end of file diff --git a/models/__pycache__/__init__.cpython-310.pyc b/models/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..86b11ce Binary files /dev/null and b/models/__pycache__/__init__.cpython-310.pyc differ diff --git a/models/__pycache__/bank_rec_widget.cpython-310.pyc b/models/__pycache__/bank_rec_widget.cpython-310.pyc new file mode 100644 index 0000000..472029d Binary files /dev/null and b/models/__pycache__/bank_rec_widget.cpython-310.pyc differ diff --git a/models/bank_rec_widget.py b/models/bank_rec_widget.py index db30b58..206f52f 100644 --- a/models/bank_rec_widget.py +++ b/models/bank_rec_widget.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- -from odoo import models - - -class BankRecWidget(models.Model): - _inherit = "bank.rec.widget" - - def _line_value_changed_ref(self, line): - """ - Persist the typed Reference as both: - - Journal Entry Reference (move.ref) so it shows on journal items - - Statement Line Reference (st_line.ref) so it remains visible after validation - Works for liquidity and non-liquidity lines in Manual Operations. - """ - self.ensure_one() - ref_val = line.ref or False - # Persist to the move (journal entry) - self.st_line_id.move_id.ref = ref_val - # Persist to the statement line so the OWL form keeps showing it after validation - # (bank_rec_form.xml shows Reference for liquidity based on line.data.ref which maps to st_line.ref) - self.st_line_id.ref = ref_val - # Reload liquidity line and the record to reflect the updated reference - self._action_reload_liquidity_line() - self.return_todo_command = {"reset_record": True, "reset_global_info": True} - - def _action_validate(self): - """ - Ensure the typed Reference is flushed to the target move before reconciliation creates/replaces lines. - This covers the case when the user clicks Validate immediately after typing in Manual Operations. - """ - self.ensure_one() - line = self._lines_get_line_in_edit_form() - if line and getattr(line, "ref", False): - ref_val = line.ref - self.st_line_id.move_id.ref = ref_val - self.st_line_id.ref = ref_val +# -*- coding: utf-8 -*- +from odoo import models + + +class BankRecWidget(models.Model): + _inherit = "bank.rec.widget" + + def _line_value_changed_ref(self, line): + """ + Persist the typed Reference as both: + - Journal Entry Reference (move.ref) so it shows on journal items + - Statement Line Reference (st_line.ref) so it remains visible after validation + Works for liquidity and non-liquidity lines in Manual Operations. + """ + self.ensure_one() + ref_val = line.ref or False + # Persist to the move (journal entry) + self.st_line_id.move_id.ref = ref_val + # Persist to the statement line so the OWL form keeps showing it after validation + # (bank_rec_form.xml shows Reference for liquidity based on line.data.ref which maps to st_line.ref) + self.st_line_id.ref = ref_val + # Reload liquidity line and the record to reflect the updated reference + self._action_reload_liquidity_line() + self.return_todo_command = {"reset_record": True, "reset_global_info": True} + + def _action_validate(self): + """ + Ensure the typed Reference is flushed to the target move before reconciliation creates/replaces lines. + This covers the case when the user clicks Validate immediately after typing in Manual Operations. + """ + self.ensure_one() + line = self._lines_get_line_in_edit_form() + if line and getattr(line, "ref", False): + ref_val = line.ref + self.st_line_id.move_id.ref = ref_val + self.st_line_id.ref = ref_val return super()._action_validate() \ No newline at end of file diff --git a/static/src/xml/bank_rec_form_inherit.xml b/static/src/xml/bank_rec_form_inherit.xml index 2491cfb..ee218c0 100644 --- a/static/src/xml/bank_rec_form_inherit.xml +++ b/static/src/xml/bank_rec_form_inherit.xml @@ -1,29 +1,29 @@ - - - - - -
-
- -
-
-
- - -
-
-
-
- - - - - false - -
+ + + + + +
+
+ +
+
+
+ + +
+
+
+
+ + + + + false + +
\ No newline at end of file diff --git a/views/account_reconcile_views.xml b/views/account_reconcile_views.xml index 26e4d24..223318f 100644 --- a/views/account_reconcile_views.xml +++ b/views/account_reconcile_views.xml @@ -1,16 +1,16 @@ - - - - - account.move.line.tree.reconcile.inherit.ref.visible - account.move.line - - - - show - 0 - - - - + + + + + account.move.line.tree.reconcile.inherit.ref.visible + account.move.line + + + + show + 0 + + + + \ No newline at end of file diff --git a/views/bank_rec_widget_views.xml b/views/bank_rec_widget_views.xml index ac95bbe..08e9caf 100644 --- a/views/bank_rec_widget_views.xml +++ b/views/bank_rec_widget_views.xml @@ -1,42 +1,42 @@ - - - - - - account.bank.statement.line.kanban.inherit.ref - account.bank.statement.line - - - -
- -
-
-
-
- - - - account.bank.statement.line.tree.inherit.ref.visible - account.bank.statement.line - - - - show - - - - - - - account.bank.statement.line.search.inherit.add.ref - account.bank.statement.line - - - - - - - -
+ + + + + + account.bank.statement.line.kanban.inherit.ref + account.bank.statement.line + + + +
+ +
+
+
+
+ + + + account.bank.statement.line.tree.inherit.ref.visible + account.bank.statement.line + + + + show + + + + + + + account.bank.statement.line.search.inherit.add.ref + account.bank.statement.line + + + + + + + +
\ No newline at end of file