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

[FIX] account: print multiple GL

When several accounts are selected to print their GL, the GL of only one
is printed. This is due to two issues:
- 'active_id' is retrieved instead of 'active_ids'
- the method `get_action` is called with the wrong records. `self`
  refers to the wizard, not to the accounts selected.

opw-676061
parent 34f09a0e
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ class ReportGeneralLedger(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', []))
init_balance = data['form'].get('initial_balance', True)
sortby = data['form'].get('sortby', 'sort_date')
......
......@@ -19,4 +19,5 @@ class AccountReportGeneralLedger(models.TransientModel):
data['form'].update(self.read(['initial_balance', 'sortby'])[0])
if data['form'].get('initial_balance') and not data['form'].get('date_from'):
raise UserError(_("You must define a Start Date"))
return self.env['report'].with_context(landscape=True).get_action(self, 'account.report_generalledger', data=data)
records = self.env[data['model']].browse(data.get('ids', []))
return self.env['report'].with_context(landscape=True).get_action(records, 'account.report_generalledger', 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