bank_statement_reconciliation/models/bank_statement_selector.py
2025-10-25 21:44:56 +07:00

29 lines
1.2 KiB
Python

from odoo import models, fields, api
class BankStatementSelector(models.TransientModel):
_name = 'bank.statement.selector'
_description = 'Bank Statement Selector'
journal_id = fields.Many2one('account.journal',
string='Bank Journal',
domain=[('type', '=', 'bank')],
required=True)
def action_show_statement_lines(self):
"""Open the bank statement lines for the selected journal"""
action = {
'type': 'ir.actions.act_window',
'name': 'Bank Statement Lines',
'res_model': 'account.bank.statement.line',
'view_mode': 'tree,form',
'domain': [('journal_id', '=', self.journal_id.id)],
'context': {
'search_default_journal_id': self.journal_id.id,
},
'views': [
(self.env.ref('bank_statement_reconciliation.view_account_bank_statement_line_tree').id, 'tree'),
(self.env.ref('bank_statement_reconciliation.view_account_bank_statement_line_form').id, 'form')
]
}
return action