首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何删除Odoo-9中销售订单报告qweb中的“product_code”字段?

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

Stack Overflow用户
提问于 2016-11-13 12:41:36
回答 1查看 1.4K关注 0票数 1

在Odoo系统中,如果您在产品模板中设置了product_code (interal reference),那么在qweb报告中也会显示这个注释。我只想得到产品的名称在销售订单qweb报告,它可以删除(或隐藏) product_code字段报告吗?如果是的话,请帮助我具体说明解决问题的正确步骤。谢谢我的qweb代码:

代码语言:javascript
复制
                    </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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-13 16:32:52

在sale.order.line对象名称字段中,将产品名称和代码结合起来存储值。在“产品”字段的更改上设置名称字段值。

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

替换以下代码:

代码语言:javascript
复制
<strong><span t-field="l.name"/></strong>

使用

代码语言:javascript
复制
<strong><span t-field="l.product_id.name"/></strong>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40573946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档