commit eb2cd470e7769ccd4a3f0ca8da85cebc51199ca6 Author: Suherdy SYC. Yacob Date: Mon Sep 29 14:43:59 2025 +0700 first commit diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..a6ffc5f --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# Account Reconciliation Reference addon +from . import models \ No newline at end of file diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..cd9760c --- /dev/null +++ b/__manifest__.py @@ -0,0 +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, +} \ No newline at end of file diff --git a/__pycache__/__init__.cpython-312.pyc b/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..6bdb85e Binary files /dev/null and b/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..3e9d119 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import bank_rec_widget \ No newline at end of file diff --git a/models/__pycache__/__init__.cpython-312.pyc b/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..7b806b1 Binary files /dev/null and b/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/__pycache__/bank_rec_widget.cpython-312.pyc b/models/__pycache__/bank_rec_widget.cpython-312.pyc new file mode 100644 index 0000000..31615db Binary files /dev/null and b/models/__pycache__/bank_rec_widget.cpython-312.pyc differ diff --git a/models/bank_rec_widget.py b/models/bank_rec_widget.py new file mode 100644 index 0000000..db30b58 --- /dev/null +++ b/models/bank_rec_widget.py @@ -0,0 +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 + 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 new file mode 100644 index 0000000..2491cfb --- /dev/null +++ b/static/src/xml/bank_rec_form_inherit.xml @@ -0,0 +1,29 @@ + + + + + +
+
+ +
+
+
+ + +
+
+
+
+ + + + + false + +
+
\ No newline at end of file diff --git a/views/account_reconcile_views.xml b/views/account_reconcile_views.xml new file mode 100644 index 0000000..26e4d24 --- /dev/null +++ b/views/account_reconcile_views.xml @@ -0,0 +1,16 @@ + + + + + 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 new file mode 100644 index 0000000..ac95bbe --- /dev/null +++ b/views/bank_rec_widget_views.xml @@ -0,0 +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 + + + + + + + +
+
\ No newline at end of file