Not allowed to post comments to my own question. I did not paste the code exactly how I had it. After reviewing the answers, I created a module and tested fresh and this issue still seems valid. My Odoo version id 12.0 with git log showing
commit c9bedcc0efc71d71e26410db2ec1db1f4009a0b6 (HEAD -> 12.0, origin/12.0)
Author: Andrea Grazioso (agr-odoo) <agr@odoo.com>
Date: Fri Nov 8 09:39:40 2019 +0000
I also committed the test module to git
https://github.com/aliomattux/mrp_production_report
Error below. To me definitely seems like bug. I moved the entire module over to dictionary from custom function with identical template and it works. Was the only way I could get it to work.
Traceback (most recent call last):
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1671, in report_download
response = self.report_routes(reportname, docids=docids, converter=converter)
File "/opt/odoo/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1612, in report_routes
pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]
File "/opt/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 711, in render_qweb_pdf
html = self.with_context(context).render_qweb_html(res_ids, data=data)[0]
File "/opt/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 751, in render_qweb_html
return self.render_template(self.report_name, data), 'html'
File "/opt/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 534, in render_template
return view_obj.render_template(template, values)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 1304, in render_template
return self.browse(self.get_view_id(template)).render(values, engine)
File "/opt/odoo/odoo/addons/web_editor/models/ir_ui_view.py", line 27, in render
return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 1313, in render
return self.env[engine].render(self.id, qcontext)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_qweb.py", line 59, in render
result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 274, in render
self.compile(template, options)(self, body.append, values or {})
File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 353, in _compiled_fn
raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
odoo.addons.base.models.qweb.QWebException: list indices must be integers or slices, not str
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 346, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_950_68
File "<template>", line 2, in body_call_content_67
File "<template>", line 3, in foreach_66
File "<template>", line 4, in body_call_content_65
File "<template>", line 96, in foreach_64
TypeError: list indices must be integers or slices, not str
Error to render compiling AST
TypeError: list indices must be integers or slices, not str
Template: 950
Path: /templates/t/t/t/t/div/table/tbody/t/t[2]/tr/td/span
Node: <span t-esc="line['sku']"/>
I teste