Commit Graph

55 Commits (093beb0ad2d643f1f87b23e93f7fd8b23d1e41bc)

Author SHA1 Message Date
Víctor Martínez cff464e5ac [FIX] account_reconcile_oca: Avoiding the singleton error related to _get_reconcile_line()
Example use case:
 File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 541, in _compute_reconcile_data_info
    record.reconcile_data_info = record._default_reconcile_data(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 698, in _default_reconcile_data
    reconcile_auxiliary_id, lines = self._get_reconcile_line(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 1164, in _get_reconcile_line
    new_vals = super()._get_reconcile_line(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_reconcile_abstract.py", line 49, in _get_reconcile_line
    original_amount = amount = net_amount = line.debit - line.credit
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1154, in __get__
    record.ensure_one()
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5204, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: account.move.line(208, 211, 212)

TT55221
2025-02-28 14:43:53 +01:00
Jordi Ballester Alomar d4b9d8f83d [FIX] account_reconcile_oca: use lazy translation 2025-02-25 18:33:35 +01:00
Jordi Ballester Alomar f81e2e5ec9 [FIX] account_reconcile_oca: force update of data in posted journal entry 2025-02-25 18:30:57 +01:00
Alexis de Lattre fee65b9d9e [MIG] account_reconcile_oca from v17 to v18 2025-02-25 18:30:57 +01:00
Víctor Martínez 908daaaa01 [FIX] account_reconcile_oca: Set the appropriate value for partner_id to avoid warning log
WARNING prod py.warnings: /opt/odoo/auto/addons/account/models/account_move.py:4651: UserWarning: unsupported operand type(s) for "==": 'res.partner()' == '403'
2025-02-25 18:30:56 +01:00
Víctor Martínez e8dee468ca [FIX] account_reconcile_oca: Replace name_get() to delete the warning log
WARNING prod py.warnings: /opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py:616: DeprecationWarning: Since 17.0, deprecated method, read display_name instead
2025-02-25 18:30:56 +01:00
Enric Tobella 90262374d8 [IMP] account_reconcile_oca: Allow to select all lines at once 2025-02-25 18:30:56 +01:00
Florian da Costa 2155c5a08d [FIX] Replace removed compute method by _convert 2025-02-25 18:30:56 +01:00
Florian da Costa dbd55e8fa5 [FIX] partner update from reconciliation widget
We cant to avoid to change amounts on accounting entries during the reconciliation process. One of the goal is to avoid a following case :
The statement line is created in a foreign currency journal, later, the rate is updated in Odoo.
During reconciliation process, the partner is set on liquidity line, the accounting entries are synchronized and the balance changes.
2025-02-25 18:30:56 +01:00
Florian da Costa a42eae4fab [FIX] Synchronise partner from statement line to accounting entries
We need to look at the reconcile_data to find the partner as the manual_partner_id can contain the information of an auxiliary line
2025-02-25 18:30:56 +01:00
Víctor Martínez dbd81a38c7 [FIX] account_reconcile_oca: Synchronize manual_partner_id with partner_id without onchange or subsequent changes with the _synchronize_to_moves() method.
We do not define partner_id with the value of manual_partner_id to prevent _synchronize_to_moves()
from making changes to the account.move.line leaving unintended values and/or data.

Re-define the value of reconcile_data_info if the _synchronize_to_moves() method has changed
anything on the lines.

Related to https://github.com/OCA/account-reconcile/issues/779

TT52634
2025-02-25 18:30:56 +01:00
Sergio Bustamante 7da5bc0d24 [FIX] account_reconcile_oca: Fix currency and amount when using reconciliation models 2025-02-25 18:30:56 +01:00
Florian da Costa eae996e13f [FIX] Wrong amount currency compute in case of change in liquidity line 2025-02-25 18:30:56 +01:00
Florian da Costa 0e4f79c908 [FIX] fix _check_line_changed partner check 2025-02-25 18:30:56 +01:00
Enric Tobella 20f60cfe62 [FIX] account_reconcile_oca: Update currency_amount 2025-02-25 18:30:56 +01:00
Florian da Costa 4fe0125cc9 [FIX] account_reconcile_oca : exchange rate gain/loss currency and amount
If currency amount is not 0, the suspense line will have wrong amount
2025-02-25 18:30:56 +01:00
Florian da Costa 829299dffe [FIX] account_reconcile_oca : max_amount rounding error leading to unwanted currency conversion 2025-02-25 18:30:56 +01:00
Florian da Costa bf6e1d23a0 [FIX] account_reconcile_oca : foreign currency reconcile with late currency rate
It is possible that the statement line in foreign currency is created before the rate of the day is updated in Odoo. In this case we need to take the real rate of the statement line to comput the exchange rate
2025-02-25 18:30:56 +01:00
Florian da Costa 7d92a34370 [FIX] account_reconcile_oca : Fix multi currency management
Fix the case of payment with a foreign currency set on bank statement line

improve tests around multi-currency
2025-02-25 18:30:56 +01:00
Enric Tobella 82677beb24 [IMP] account_reconcile_oca: Improve multicurrency management.
We will use currency of the line in order to get the suspense and max line value
2025-02-25 18:30:56 +01:00
Tom b609cb3f75 [FIX] #11339 account_reconcile_oca: KeyError on data 2025-02-25 18:30:56 +01:00
Víctor Martínez 2f1543ab31 [IMP] account_reconcile_oca: Add auto-reconcile compatibility (Example: Rule to match invoices/bills)
TT52146

[FIX] account_reconcile_oca: Fix test related to match_text_location fields

Related to 8948b31407

TT52146
2025-02-25 18:30:56 +01:00
bobrador 3b72107e01 [FIX] account_reconcile_oca: Fixed analytic distribution update
This fixes a bug that occurred when both account_reconcile_oca and account_reconcile_model_oca modules were installed. The issue arose when assigning an analytic account and making no further changes, causing the analytic account to not be set correctly. As a result, the reconciliation process failed to create the analytic entries properly. This line: ensures that if the analytic distribution has changed, it will be correctly updated.
2025-02-25 18:30:56 +01:00
bobrador 09b42b2f1c [IMP] account_reconcile_oca: Add validation for applicability of analytic plans
adds validation for the applicability of analytic plans, ensuring that mandatory plans or accounts requiring analytic imputations are properly validated.

    The validate_analytic context is used in the analytic mixin to validate the applicability of analytic plans when generating analytic lines.
2025-02-25 18:30:56 +01:00
Enric Tobella a99a1bfdee [IMP] account_reconcile_oca: Use receivable/payable account on statements with partner as suspense account 2025-02-25 18:30:56 +01:00
Víctor Martínez 573ea40921 [IMP] account_reconcile_oca: Hook methods
Useful for extensions like this one https://github.com/OCA/account-reconcile/pull/758

TT51885
2025-02-25 18:30:56 +01:00
Florian da Costa d0ac654b60 [FIX] account_reconcile_oca : keep partner line case of manual button reconcile 2025-02-25 18:30:56 +01:00
Florian da Costa 33a3206813 [16][FIX] account_reconcile_oca : keep aml label when empty on manual write-off reconcile model 2025-02-25 18:30:56 +01:00
Víctor Martínez 2657e217f0 [IMP] account_reconcile_oca: Remove warning: Two fields have the same label: Manual In Currency.
WARNING devel odoo.addons.base.models.ir_model: Two fields
(manual_in_currency_id, manual_in_currency) of account.bank.statement.line()
have the same label: Manual In Currency.
[Modules: account_reconcile_oca and account_reconcile_oca]
2025-02-25 18:30:56 +01:00
Víctor Martínez 710faabe79 [IMP] account_reconcile_oca: Remove warning (deprecated method, read display_name instead)
WARNING devel py.warnings: /opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py:938:
DeprecationWarning: Since 17.0, deprecated method, read display_name instead
2025-02-25 18:30:56 +01:00
Enric Tobella b9d1d6dbc0 [FIX] account_reconcile_oca: Fix wrong display on reconciled moves
If your reconcile an invoice and in the old option, the reconcile widget shows something weird with three lines but we should have only two. The data was right with 2 lines only.
2025-02-25 18:30:56 +01:00
Enric Tobella a76687b58e [IMP] account_reconcile_oca: Compute the exchange rate properly 2025-02-25 18:30:56 +01:00
Enric Tobella 97984ebaa9 [IMP] account_reconcile_oca: Fix multi currency computation 2025-02-25 18:30:56 +01:00
PNurm 36391a9196 [FIX] account_reconcile_oca: Pass partner parameter correctly to _get_write_off_move_lines_dict 2025-02-25 18:30:56 +01:00
JordiMForgeFlow 9d6a70a4fc [IMP] account_reconcile_oca: reverse reconcile entry when resetting reconciliation in keep mode 2025-02-25 18:30:56 +01:00
Pedro M. Baeza 095590cdc2 [FIX] *: pre-commit fixes
Due to latest copier template with all the checks.
2025-02-25 18:30:56 +01:00
Enric Tobella b416169cf0 [IMP] account_reconcile_oca: Allow aggregation for more parameters 2025-02-25 18:30:56 +01:00
Enric Tobella 60f3c69907 [IMP] account_reconcile_oca: Allow to define the statement directly 2025-02-25 18:30:56 +01:00
Enric Tobella 8cf2ab4172 [FIX] account_reconcile_oca: Use counterparts properly 2025-02-25 18:30:56 +01:00
Enric Tobella 6f6c55054c [FIX] account_reconcile_oca: Fix foreign currency 2025-02-25 18:30:56 +01:00
Enric Tobella 14a1ea3a9e [MIG] account_reconcile_oca: Finish migration 2025-02-25 18:30:56 +01:00
Henrik Norlin 103a4c506b [MIG] account_reconcile_oca: Migration to 17.0 2025-02-25 18:30:56 +01:00
Henrik Norlin f60c15ffb0 [IMP] account_reconcile_oca: black, isort, prettier 2025-02-25 18:30:56 +01:00
Enric Tobella b649d8a299 [UPD] account_reconcile_oca: Add Dixmit as author 2025-02-25 18:30:56 +01:00
Andrea Stirpe e150b99b99 [16.0][IMP] account_reconcile_oca: display partner_name 2025-02-25 18:30:56 +01:00
Enric Tobella 839d71d162 [FIX] account_reconcile_oca: Show manual amount in the right currency 2025-02-25 18:30:56 +01:00
Enric Tobella 7455e1f2e6 [IMP] account_reconcile_oca: only store info on unreconciled items 2025-02-25 18:30:56 +01:00
Enric Tobella 9866a79959 [FIX] account_reconcile_oca: Models where failing on default with a different currency 2025-02-25 18:30:56 +01:00
Enric Tobella 80b5430127 [FIX] account_reconcile_oca: Make it work with foreign currency 2025-02-25 18:30:56 +01:00
Enric Tobella 664158ddfb [IMP] account_reconcile_oca: Include taxes from models
Fixes #576
2025-02-25 18:30:56 +01:00