I need to display accounting information on POS orders tree view. How can I display journal name, credit, and the debit amount in the post order tree view?Given code showing the blank result in the tree view. Here is tried a code, please help me as I am new in Odoo programming
statement_ids = fields.One2many
(
'account.bank.statement.line',
'pos_statement_id',
string='Payments',
states={'draft': [('readonly', False)]},
readonly=True
)
journal_id = fields.Char
(
compute='_get_journals',
string="journal" ,
states={'draft': [('readonly', False)]},
store=True,readonly=True
)
@api.depends('statement_ids')
def _get_journals(self):
acc_lines = self.env['account.bank.statement.line']
acc_journals = self.env['account.journal']
for record in self:
acc_res = acc_lines.search(['statement_ids'])
record.journal_id = acc_journals.search(['acc_res.journal_id.id'])