odoo/addons/account/wizard/account_report_trial_balance.py

17 lines
648 B
Python

# -*- coding: utf-8 -*-
from odoo import fields, models
class AccountBalanceReport(models.TransientModel):
_inherit = "account.common.account.report"
_name = 'account.balance.report'
_description = 'Trial Balance Report'
journal_ids = fields.Many2many('account.journal', 'account_balance_report_journal_rel', 'account_id', 'journal_id', string='Journals', required=True, default=[])
def _print_report(self, data):
data = self.pre_print_report(data)
records = self.env[data['model']].browse(data.get('ids', []))
return self.env['report'].get_action(records, 'account.report_trialbalance', data=data)