在Odoo系统中,如果您在产品模板中设置了product_code (interal reference),那么在qweb报告中也会显示这个注释。我只想得到产品的名称在销售订单qweb报告,它可以删除(或隐藏) product_code字段报告吗?如果是的话,请帮助我具体说明解决问题的正确步骤。谢谢我的qweb代码:
</tr>
<t t-set="index" t-value="0"/>
<t t-set="product" t-value="0"/>
<t t-foreach="doc.handle_orderline(doc.order_line)" t-as="product_line">
<t t-set="product_num" t-value="0"/>
<t t-set="index" t-value="index + 1"/>
<t t-foreach="product_line" t-as="l">
<t t-set="product_num" t-value="product_num+1"/>
<t t-if="not l.product_uom_qty">
<t t-set="index" t-value="index - 1"/>
</t>
<tr t-if="l.product_uom_qty">
<t t-if="product_num == 1">
<td class="text-center" t-att-rowspan="len(product_line)">
<span t-esc="index"/>
</td>
<td class="text-center" t-att-rowspan="len(product_line)">
<strong><span t-field="l.name"/></strong>
<br/>
<t t-if="l.width_id">( <span style="font-style:italic" t-field="l.width_id.name"/> )</t>
</td>
</t>发布于 2016-11-13 16:32:52
在sale.order.line对象名称字段中,将产品名称和代码结合起来存储值。在“产品”字段的更改上设置名称字段值。
因此,在QWEB报告中,我们需要从product_id字段中获取值,以显示产品名称。
替换以下代码:
<strong><span t-field="l.name"/></strong>使用
<strong><span t-field="l.product_id.name"/></strong>https://stackoverflow.com/questions/40573946
复制相似问题