Skip to content

Commit cea09c4

Browse files
committed
Merge PR #866 into 17.0
Signed-off-by pedrobaeza
2 parents 9761b1c + e0175a8 commit cea09c4

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

account_reconcile_oca/models/res_company.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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

45
from 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

0 commit comments

Comments
 (0)