(odoo10)如何在pdf发票中添加产品属性 [英] (odoo10) how to add product attributes in pdf invoice

查看:166
本文介绍了(odoo10)如何在pdf发票中添加产品属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pls建议如何将产品属性添加到pdf发票中. 目前,我们正在印刷产品SCU:

pls advice how to add product attributes into pdf invoice. Currently we printing product 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 +属性,例如:

and it looks a bit ugly on invoice. pls advice how to add product template like l.product_id.name + attributes, like:

另外,您能否请教如何将属性放在产品名称下方? 这是我的代码:

also, could you pls advice how to put attributes below product name? here is my code now:

        <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>

我想要这样: 提前非常感谢!

i'd like to have it like that: many thanks in advance!

推荐答案

您将需要执行以下操作来输出产品属性名称和值:

You will need to do something like this to output the product attributes name and value:

<t t-esc="', '.join(['%s: %s' % (attribute_value.attribute_id.name, attribute_value.name) for attribute_value in l.product_id.attribute_value_ids])"/>:

这篇关于(odoo10)如何在pdf发票中添加产品属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆