I want to print a custom modul in PDF. To do so, I a made a report but i can not manage to print, i'm getting this error:
Traceback (most recent call last): File "C:\Program Files\Odoo15\server\odoo\addons\web\controllers\main.py", line 2017, in report_download response = self.report_routes(reportname, docids=docids, converter=converter, context=context) File "C:\Program Files\Odoo15\server\odoo\http.py", line 535, in response_wrap response = f(*args, **kw) File "C:\Program Files\Odoo15\server\odoo\addons\web\controllers\main.py", line 1946, in report_routes pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0] File "C:\Program Files\Odoo15\server\odoo\addons\account\models\ir_actions_report.py", line 49, in _render_qweb_pdf return super()._render_qweb_pdf(res_ids=res_ids, data=data) File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_actions_report.py", line 898, in _render_qweb_pdf bodies, html_ids, header, footer, specific_paperformat_args = self_sudo.with_context(context)._prepare_html(html) File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_actions_report.py", line 366, in _prepare_html body_parent = root.xpath('//main')[0] IndexError: list index out of range
Here is my code for the report:
<odoo>
<record id="print_sheets"model="ir.actions.report">
<field name="name">Fiche d'interventionfield><fieldname="model">intervention.interventionsheetsfield><fieldname="report_type">qweb-pdffield><fieldname="report_name">intervention.printed_sheetfield><fieldname="report_file">intervention.printed_sheetfield><fieldname="binding_model_id"ref="model_intervention_interventionsheets"/>
<fieldname="binding_type">reportfield>record>
<templateid="printed_sheet"><tcall="web.html_container"><tt-foreach="docs"t-as="o"><tt-call="web.internal_layout"><center><h1>Fiche d'interventionh1>center><spant-field="o.name">span>t>t>t>template>odoo>
I have followed the video :
https://www.youtube.com/watch?v=evXKEMFc3FQ
But i think i miss something and i can"t get what.
Thank for your anwsers.
Ewen JEZEQUEL
i don't know why but i can't manage to send my code properly easer