'Look up a report definition and render the report for the provided IDs.'

@api.model
def render_report(self, res_ids, name, data):

    report = self._lookup_report(name)
    if isinstance(report, basestring):
        if (tools.config['test_enable'] and (not tools.config['test_report_directory'])):
            return (self.env['report'].get_html(res_ids, report, data=data), 'html')
        else:
            return (self.env['report'].get_pdf(res_ids, report, data=data), 'pdf')
    else:
        return report.create(self._cr, self._uid, res_ids, data, context=self._context)
