From 0fc7f3d00e4d60bbeb425b02a07d5802c5899803 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Fri, 6 Mar 2026 11:17:22 +0700 Subject: [PATCH] first commit --- .gitignore | 17 +++++++++++++++++ README.md | 10 ++++++++++ __init__.py | 1 + __manifest__.py | 19 +++++++++++++++++++ models/__init__.py | 1 + models/account_bank_statement_line.py | 10 ++++++++++ 6 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 __manifest__.py create mode 100644 models/__init__.py create mode 100644 models/account_bank_statement_line.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fdb3a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class + +# OS +.DS_Store +Thumbs.db + +# IDEs +.idea/ +.vscode/ + +# Build +build/ +dist/ +*.egg-info/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a34369c --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Account Bank Rec Date Filter + +This Odoo 17 module modifies the bank reconciliation widget so that the "Match Existing Entries" tab only shows journal items on or before the bank statement line's date. This prevents showing future journal items when matching bank statement lines. + +## Features +- Overrides `_get_default_amls_matching_domain` in `account.bank.statement.line`. +- Applies a `'date', '<=', statement_line.date` domain filter to counterpart journal items. + +## Author +Suherdy Yacob diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..86e06aa --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,19 @@ +{ + 'name': 'Account Bank Rec Date Filter', + 'version': '17.0.1.0.0', + 'category': 'Accounting/Localizations', + 'summary': 'Filter bank reconciliation counterpart journal items by statement date', + 'description': """ + This module modifies the bank reconciliation widget so that the "Match Existing Entries" + tab only shows journal items up to the bank statement line's date. + """, + 'author': 'Suherdy Yacob', + 'website': '', + 'depends': ['account', 'account_accountant'], + 'data': [ + ], + 'installable': True, + 'application': False, + 'auto_install': False, + 'license': 'LGPL-3', +} diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..b625fd6 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1 @@ +from . import account_bank_statement_line diff --git a/models/account_bank_statement_line.py b/models/account_bank_statement_line.py new file mode 100644 index 0000000..98a8a62 --- /dev/null +++ b/models/account_bank_statement_line.py @@ -0,0 +1,10 @@ +from odoo import models, fields + +class AccountBankStatementLine(models.Model): + _inherit = 'account.bank.statement.line' + + def _get_default_amls_matching_domain(self): + domain = super()._get_default_amls_matching_domain() + if self.date: + domain.append(('date', '<=', fields.Date.to_string(self.date))) + return domain