File tree Expand file tree Collapse file tree
account_reconcile_oca/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Copyright 2024 Dixmit
2+ # Copyright 2025 Tecnativa - Víctor Martínez
23# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
34
45from odoo import fields , models
@@ -12,3 +13,27 @@ class ResCompany(models.Model):
1213 ._fields ["reconcile_aggregate" ]
1314 .selection
1415 )
16+
17+ def _get_fiscalyear_lock_statement_lines_redirect_action (
18+ self , unreconciled_statement_lines
19+ ):
20+ """Define the appropriate views that this method will have, by default the
21+ account module does not add any.
22+ """
23+ action = super ()._get_fiscalyear_lock_statement_lines_redirect_action (
24+ unreconciled_statement_lines
25+ )
26+ if len (unreconciled_statement_lines ) == 1 :
27+ custom_action = self .env ["ir.actions.actions" ]._for_xml_id (
28+ "account_reconcile_oca.action_bank_statement_line_create"
29+ )
30+ action .update (views = custom_action ["views" ])
31+ else :
32+ custom_action = self .env ["ir.actions.actions" ]._for_xml_id (
33+ "account_reconcile_oca.action_bank_statement_line_reconcile_all"
34+ )
35+ action .update (
36+ view_mode = custom_action ["view_mode" ],
37+ views = custom_action ["views" ],
38+ )
39+ return action
You can’t perform that action at this time.
0 commit comments