【问题标题】:How to display product category name on product.supplierinfo.tree.view on Odoo?如何在 Odoo 上的 product.supplierinfo.tree.view 上显示产品类别名称?
【发布时间】:2018-03-07 14:57:01
【问题描述】:

我想在 Odoo 上的product.supplierinfo.tree.view 中显示相关产品类别名称?

这是一个供应商价目表捕获

【问题讨论】:

    标签: python odoo odoo-view odoo-11


    【解决方案1】:

    只需创建一个related field

    product_category = fields.Many2one(
        string='Product Category',
        related='product_tmpl_id.category_id',
        comodel_name='product.category',
    )
    

    并像往常一样将其添加到树视图中:

    <record id="product_supplierinfo_tree_view" model="ir.ui.view">
        <field name="name">product.supplierinfo.tree.view</field>
        <field name="model">product.supplierinfo</field>
        <field name="inherit_id" ref="product.product_supplierinfo_tree_view" />
        <field name="arch" type="xml">
            <field name="name" position="after">
                <field name="product_category" />
            </field>
        </field>
    </record>
    

    【讨论】:

      猜你喜欢
      • 2019-08-09
      • 1970-01-01
      • 1970-01-01
      • 2015-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-03
      • 1970-01-01
      相关资源
      最近更新 更多