Skip to content
Snippets Groups Projects
Commit e2eecd73 authored by mreficent's avatar mreficent Committed by fw-bot
Browse files

[DOC] render_html -> _get_report_values


closes odoo/odoo#39614

X-original-commit: 9beebf2b
Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent b69dcf71
No related branches found
No related tags found
No related merge requests found
......@@ -284,7 +284,7 @@ named :samp:`report.{module.report_name}`. If it exists, it will use it to
call the QWeb engine; otherwise a generic function will be used. If you wish
to customize your reports by including more things in the template (like
records of others models, for example), you can define this model, overwrite
the function ``render_html`` and pass objects in the ``docargs`` dictionary:
the function ``_get_report_values`` and pass objects in the ``docargs`` dictionary:
.. code-block:: python
......@@ -292,16 +292,17 @@ the function ``render_html`` and pass objects in the ``docargs`` dictionary:
class ParticularReport(models.AbstractModel):
_name = 'report.module.report_name'
@api.model
def render_html(self, docids, data=None):
report_obj = self.env['report']
def _get_report_values(self, docids, data=None):
report_obj = self.env['ir.actions.report']
report = report_obj._get_report_from_name('module.report_name')
docargs = {
'doc_ids': docids,
'doc_model': report.model,
'docs': self,
}
return report_obj.render('module.report_name', docargs)
return docargs
.. _reference/reports/custom_fonts:
......
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