Thursday, June 19, 2025
2 changes · saas-18.3
Resolved issues and error corrections
Bank statement reconciliation now uses stricter matching rules to avoid linking payments to the wrong statement lines. The update also fixes transaction filtering when fetching bank data and ensures CSV-imported statements can trigger automatic matching correctly.
Original PR description
In this commit: https://github.com/odoo/enterprise/commit/c0f8c5d17b9d78b640d744d8bfb6a2bb4002776a, we changed the way payment are matched with statement lines. Before, we were splitting the aml.ref based on ' ', then check for each word if there is an equivalent in the st_line label. But this is not restrictive enough. So now, there is the rules we apply, in the right order : 1 - Check if there is a payment ref like SO|INV|BILL|...xxxx/xxx-yy in the aml.ref 2 - Check for full match with aml.ref 3 - Check if there is a word more than 16 characters long who match with aml.ref 4 - Check for full match with aml.move_name 5 - Check for full match with move.payment_reference If we have any multiple match, we don't reconcile. no-task
Fixes an issue where Accounting could crash while users assigned the same account across multiple bank statement lines. This makes bank transaction reconciliation more reliable and prevents interruptions during routine bookkeeping work.
Original PR description
The system will crash when we try to set the account for statement lines. And at [1], we can see that this fetches the `previous_statement_lines`. [1]…
The system will crash when we try to set the account for statement lines. And at [1], we can see that this fetches the `previous_statement_lines`. [1] https://github.com/odoo/enterprise/blob/e8f7975659f3bfea42acdc7495efeccbffe183bc/account_accountant/models/account_bank_statement.py#L654-L656 After that, it calls the `_prepare_reconciliation_rule_data` method. and try to find a `common substring`. https://github.com/odoo/enterprise/blob/e8f7975659f3bfea42acdc7495efeccbffe183bc/account_accountant/models/account_bank_statement.py#L676 In the `_get_common_substring` method, when [2] is executed, and if we have the below `payment_ref` ``` [ 'PRLV SEPA VROOMLY STR16NASUC4VSCWSRGTVURANBFJQM4LJU9 VROOMLY', 'PRLV SEPA AMAZON PAYMENTS EUROP 450X4WSOR73LFYYL 171-6087599-8440309 AMZN MKTP FR 45 0X4WSOR73LFYYL', 'PRLV SEPA VROOMLY STR16NASTLNFBLLPVADQPRANTXVPUDYDFY VROOMLY', 'VIR STRIPE VROOMLY-6NXKKON62EKBHVFLXZ3T9PTDOP5 VROOMLY', 'PRLV SEPA VROOMLY STR16NAST8PLKGEKOLWOLRANIEPSODZENR VROOMLY' ] ``` (means our len(substring) is less than 10), Then it returns `None` from line [3]. [2] https://github.com/odoo/enterprise/blob/e8f7975659f3bfea42acdc7495efeccbffe183bc/account_accountant/models/account_bank_statement.py#L777-L781 [3] https://github.com/odoo/enterprise/blob/e8f7975659f3bfea42acdc7495efeccbffe183bc/account_accountant/models/account_bank_statement.py#L780 **Steps to produce:-** 1. Install the `Accounting` module. 2. Set up the `Odoo demo bank`. 3. Click on `Transactions` under Bank. 4. Set account as `Cash Discount Loss` for `Monthly Office Rent ` and `Annual Public liability insurance`. 5. For `Deposit on the invoice 784`, set the account as other than `Cash Discount Loss` and then delete that, and again set the account as `Cash Discount Loss`. **Error:-** `AttributeError: 'NoneType' object has no attribute 'strip'` **Solution:-** - In this commit, we handle the case where `_get_common_substring` returns `None` by checking it before calling .strip(). - This prevents the system from crashing without changing the function’s return value. **Sentry - 6682820343**