Help

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

How to get all variants of a product in sales order invoice template(Odoo) ?

Avatar
Athira

In my sales order invoice template I get only one variant attribute of a product.I want to print all variants of a product in my    invoice template.I  tried this below code in report_invoice_document

<t t-set="itr" t-value="0"/> 
      <tr t-foreach="o.invoice_line_ids" t-as="l">
             <t t-set="itr" t-value="itr+1"/>
             <td><t t-esc="itr"/></td>
             <td><span t-field="l.name"/>||<span t-field="l.product_id.product_variant_ids"/>
                    <span t-field="l.product_id.is_product_variant"/>||<span t-field="l.product_id.attribute_line_ids"/>||
                    <span t-field="l.product_id.attribute_value_ids"/></td>

and I get the output               
[456] pants (Blue, Small)||product.product(2,)True||product.attribute.line(10, 11)||product.attribute.value(1, 4)

                   
Is there any solution to solve this ??
Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!