Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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
enter code here <t t-set="itr" t-value="0"/> enter code here <tr t-foreach="o.invoice_line_ids" t-as="l"> enter code here <t t-set="itr" t-value="itr+1"/> enter code here <td><t t-esc="itr"/></td> enter code here <td><span t-field="l.name"/> enter code here ||<span t-field="l.product_id.product_variant_ids"/> enter code here <span t-field="l.product_id.is_product_variant"/>|| enter code here <span t-field="l.product_id.attribute_line_ids"/>|| enter code here <span t-field="l.product_id.attribute_value_ids"/></td>
and I get the output
 pants (Blue, Small)||product.product(2,)True||product.attribute.line(10, 11)||product.attribute.value(1, 4)
Is there any solution to solve this ??
you have add loop instead of "<span t-field="l.product_id.product_variant_ids"/>" like that <t t-foreach="l.product_id.product_variant_ids" t-as="variant"><span t-field="variant.name"/></t>
also same do for "<span t-field="l.product_id.attribute_line_ids"/>, <span t-field="l.product_id.attribute_value_ids"/>"
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!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/4/16, 12:40 AM|
|Seen: 447 times|
|Last updated: 4/20/16, 8:51 AM|