Skip to content
Snippets Groups Projects
Commit d8f8d345 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: print Trial Balance

This applies commits 313bc91c and
2ad4bd48 to Trial Balance report.

opw-676061
parent 97b79a19
No related branches found
No related tags found
No related merge requests found
......@@ -58,9 +58,9 @@ class ReportTrialBalance(models.AbstractModel):
@api.multi
def render_html(self, data):
self.model = self.env.context.get('active_model')
docs = self.env[self.model].browse(self.env.context.get('active_id'))
docs = self.env[self.model].browse(self.env.context.get('active_ids', []))
display_account = data['form'].get('display_account')
accounts = self.env['account.account'].search([])
accounts = docs if self.model == 'account.account' else self.env['account.account'].search([])
account_res = self.with_context(data['form'].get('used_context'))._get_accounts(accounts, display_account)
docargs = {
......
......@@ -12,4 +12,5 @@ class AccountBalanceReport(models.TransientModel):
def _print_report(self, data):
data = self.pre_print_report(data)
return self.env['report'].get_action(self, 'account.report_trialbalance', data=data)
records = self.env[data['model']].browse(data.get('ids', []))
return self.env['report'].get_action(records, 'account.report_trialbalance', data=data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment