Page 1 of 1

correct syntax for odt template?

PostPosted: Mon Jan 13, 2014 4:43 pm
by jluitz
Dear all,

when using template-mime type "generic" the following code works like charm:
Code: Select all
{% for o in objects %}\
BOM
***********************
${o.product_qty}   [${o.code}]   ${o.name}
***********************

{% with item = search('mrp.bom',[('bom_id','=',o.id)]) %}\
{% for i in item %}\
${i.product_qty}   [${i.product_id.default_code}]   ${i.product_id.name_template}
{% end %}\
{% end %}\
{% end %}


Trying to do the same in ODT or ODS hopelessly fails returning
Code: Select all
TypeError: coercing to Unicode: need string or buffer, tuple found

The problem seems to lie in the WITH statement.

What would be the correct syntax for the WITH statement in ODS/ODT to achieve the same result?

Thanks for your help
J