Hello,
In Odoo 12, I created a custom module which will override the MRP Production report. In the report, I added a python function which is in model mrp.production. it returns a list of dictionaries. I printed to the output and verified that it returns a single list of dictionaries.
I set the variable in the report using this
<t t-set="lines" t-value="o.get_sorted_lines()"/>
I then iterate over the lines using
<t t-foreach="lines" t-as="test_line">
When I call
<span t-esc="line['product_name']"/>
I receive an error that list must be indices not str. I then alter the output to show the dictionary.
<span t-esc="line"/>
It generates the report but each line contains the list of dicts.
I don't get it. It seems like a bug to me. Calling a function which returns a valid iterable, then try to iterate but it doesn't iterate and just outputs the object. Anyone else had a similar experience?