Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2607 Lượt xem

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>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 20
7104
4
thg 2 25
15605
1
thg 7 23
3573
1
thg 5 23
3446
0
thg 10 22
5073