-
-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX]account_statement_base: add form view for bank statement to pass…
… default journal id for bank statement lines and fix compute of internal index for bank statement lines Removed unwanted field from view
- Loading branch information
1 parent
24e08fb
commit 9754d03
Showing
4 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import account_bank_statement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Onestein | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class AccountBankStatement(models.Model): | ||
_inherit = "account.bank.statement" | ||
|
||
@api.depends("line_ids.internal_index", "line_ids.state") | ||
def _compute_date_index(self): | ||
for stmt in self: | ||
sorted_lines = stmt.line_ids.filtered(lambda l: l.internal_index).sorted( | ||
"internal_index" | ||
) | ||
stmt.first_line_index = sorted_lines[:1].internal_index | ||
stmt.date = sorted_lines.filtered(lambda l: l.state == "posted")[-1:].date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters