_logger = logging.getLogger(__name__)
+
class actions(osv.osv):
_name = 'ir.actions.actions'
_table = 'ir_actions'
Look up a report definition and render the report for the provided IDs.
"""
new_report = self._lookup_report(cr, name)
- # in order to use current yml test files with qweb reports
- if isinstance(new_report, (str, unicode)):
- return self.pool['report'].get_pdf(cr, uid, res_ids, new_report, data=data, context=context), 'pdf'
+
+ if isinstance(new_report, (str, unicode)): # Qweb report
+ # The only case where a QWeb report is rendered with this method occurs when running
+ # yml tests originally written for RML reports.
+ if openerp.tools.config['test_enable'] and not tools.config['test_report_directory']:
+ # Only generate the pdf when a destination folder has been provided.
+ return self.pool['report'].get_html(cr, uid, res_ids, new_report, data=data, context=context), 'html'
+ else:
+ return self.pool['report'].get_pdf(cr, uid, res_ids, new_report, data=data, context=context), 'pdf'
else:
return new_report.create(cr, uid, res_ids, data, context)
}
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
if ('[[' in line) or ('[ [' in line):
_logger.error("Report %s may have bad expression near: \"%s\".", rname, line[80:])
# TODO more checks, what else can be a sign of a faulty report?
- elif res_format == 'foobar':
- # TODO
+ elif res_format == 'html':
pass
else:
_logger.warning("Report %s produced a \"%s\" chunk, cannot examine it", rname, res_format)