如何删除 Odoo-9 中销售订单报告 qweb 中的 'product_code' 字段?

How to remove 'product_code' field in sale order report qweb in Odoo-9?

在Odoo系统中,如果您在产品模板中设置product_code(内部引用),该注释也会显示在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>

sale.order.line对象name字段中存储产品名称和代码组合的值。在 Product 字段的 onchange 上设置的 name 字段值。

所以在QWEB报告中,我们需要从product_id字段中获取值来显示产品名称。

替换以下代码:

<strong><span t-field="l.name"/></strong>

<strong><span t-field="l.product_id.name"/></strong>