Skip to Content
Menu
This question has been flagged
2075 Views

I have a report which is printed from a wizard, I need to attach this report in an email and in attachments. But I'm getting the following error while printing the report. If I'm removing the 'attachment' attribute from report tag the report is printing.

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/home/akira/Odoo/odoo12/odoo/addons/web/controllers/main.py", line 1675, in report_download
    response = self.report_routes(reportname, converter=converter, **dict(data))
  File "/home/akira/Odoo/odoo12/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/home/akira/Odoo/odoo12/odoo/addons/web/controllers/main.py", line 1612, in report_routes
    pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]
  File "/home/akira/Odoo/odoo12/odoo/odoo/addons/base/models/ir_actions_report.py", line 718, in render_qweb_pdf
    if self.attachment and set(res_ids) != set(html_ids):
TypeError: 'NoneType' object is not iterable


 Following is my report tag,

<report id="action_my_report"
model="trip.timing.wizard"
name="module.my_report"
file="module.my_report"
string="Report - Test"
report_type="qweb-pdf"
attachment_use="True"
attachment="('Test Report' + object.id + '.pdf')"
/>

And this is how I'm calling the report from my wizard function,

return self.env.ref('module.action_my_report').report_action(self, data=self.read([])[0])


Avatar
Discard