【发布时间】:2018-10-16 15:43:32
【问题描述】:
请建议如何将产品属性添加到 pdf 发票中。 目前我们打印产品SCU:
<tr t-foreach="o.invoice_line_ids" t-as="l"> <td><span t-field="l.product_id.default_code"/></td> <td class="hidden"><span t-field="l.origin"/></td> <td class="text-right">
发票上看起来有点难看。 请建议如何添加产品模板,如 l.product_id.name + 属性,如:
另外,您能否建议如何将属性放在产品名称下方? 这是我现在的代码:
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td><span t-field="l.product_id.name"/></td>
<t t-esc="', '.join(['%s: %s' % (attribute_value.attribute_id.name, attribute_value.name) for attribute_value in l.product_id.attribute_value_ids])"/>
<td class="hidden"><span t-field="l.origin"/></td>
【问题讨论】:
-
答案是一样的,只要这样使用:
-
很好,非常感谢,已接受回答!
-
请点赞,也有帮助