Hi all,
In a QWeb report I am trying to retrieve a product template that is the template referenced from a certain selected variant.
As product_tmpl_id is the field on a product variant level referring to the template, I want to fetch the selected variant and then get the linked template.
<!-- GET TEMPLATE DATA BASED ON FIRST SELECTED VARIANT -->
<t t-set="prod_obj" t-value="request.registry['product.template']"/>
<t t-set="var_obj" t-value="request.registry['product.product']"/>
<t t-set="prodvar" t-value="var_obj.browse(request.cr, uid, [('id','=',doc_ids[0])])" />
The prodvar variable is properly set and retrieved. It returns product.product(('id', '=', 19),) when I select the variant with ID=19
The following line however gives an error :
<t t-set="prodtemp" t-value="prod_obj.browse(request.cr, uid, [('id','=',prodvar.product_tmpl_id)])" />
Also this alternative gives an error :
<t t-set="prodtemp" t-value="prod_obj.browse(request.cr, uid, [('id','=',prodvar.product_tmpl_id.id)])" />
Thanks so much for any tips. I guess it must be fairly simple to solve but don't seem to find it myself :-)
Seppe