跳至內容
選單
此問題已被標幟
1 回覆
2604 瀏覽次數

I have created a custom module that changes a view. It installs fine but when I hit update it gives an error.


Error : 

odoo.tools.convert.ParseError: "Element '<xpath expr="//field[@name='seller_ids']">' cannot be located in parent view


Looking at the module I can find the field above... very confusing.


Code:


<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="product_vendor_leadtime" model="ir.ui.view">
        <field name="name">product_vendor_leadtime</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_only_form_view"/>
        <field name="arch" type="xml">

            <xpath expr="//field[@name='seller_ids']" position="inside">
              <tree string="Vendor Information" multi_edit="1">
                <field name="sequence" widget="handle"/>
                <field name="name" readonly="1"/>
                <field name="product_id" readonly="1" optional="hide" invisible="context.get('product_template_invisible_variant', False)" groups="product.group_product_variant"/>
                <field name="product_tmpl_id" string="Product" readonly="1" invisible="context.get('visible_product_tmpl_id', True)"/>
                <field name="currency_id" groups="base.group_multi_currency"/>
                <field name="date_start" optional="hide"/>
                <field name="date_end" optional="hide"/>
                <field name="company_id" readonly="1" groups="base.group_multi_company"/>
                <field name="min_qty"/>
                <field name="product_uom" groups="uom.group_uom"/>
                <field name="delay" string="Lead Time"/>
                <field name="price" string="Price"/>
              </tree>
            </xpath>

        </field>
    </record>
</odoo>
頭像
捨棄
最佳答案

Hi, Bertus


You are getting this issue because "field[@name='seller_ids']" view is not present inside the "product" module.
That view is present inside the "purchase" module. So, you are required  to update the below line,

<field name="inherit_id" ref="purchase.view_product_supplier_inherit"/>

And also required to add dependency of "purchase" module.


Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
2月 20
7100
4
2月 25
15598
1
7月 23
3573
1
5月 23
3445
0
10月 22
5072