Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
20140 Ansichten

I get this error message

Element '' cannot be located in parent view

...every time I want to edit the field 'Registration number of the Employee' (Employee>HR Settings>Payroll). What's wrong

Avatar
Verwerfen
Beste Antwort

Hi,

1.Check whether the external id gives properly.From the for view click on the debugger and click edit form view you will get a window and copy the external id into inherit id.

<record ………………………………………


  <field name="inherit_id" ref="external_id"/>


    <field name="arch" type="xml">


        <xpath expr=”.....................................


        </xpath>


    </field>


  </field>


</record>

 

2.Check whether the field name is given properly.From the edit form itself you will get the field name and give the field name and attribute(before,after,etc) properly. You will get an idea while exploring the form view.

For adding an extra field

This field should be present in the model(python file)

<record id=....................................................................


    <field name="arch" type="xml">


        <xpath expr="//field[@name='manager_id']" position="after">


            <field name="registration_Date"/>


        </xpath>


    </field>


</record>

For disabling a field

<record id=.......................................................................


    <field name="inherit_id" ref="external_id"/>


        <xpath expr="//field[@name='first_contract_date'] position="attributes">


            <attribute name="invisible">True</attribute/>


        </xpath>


    </field>


</record>

3.Gives the module name in the manifest inside ‘depends’ which is to be inherited.

‘depends’ : [‘fleet’],

Regards

Avatar
Verwerfen
Beste Antwort

Check the Parent xml View, model, and inherit_id.

Then you have to match exact tag for xpath according to base view. 

For example, to inherit and modify any view form calendar, 

<record id="crm_calendar_inherit_view" model="ir.ui.view">
<field name="name">CRM Leads Inherit Calendarfield>
<field name="model">calendar.eventfield>
<field name="inherit_id" ref="calendar.view_calendar_event_calendar"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="opportunity_id"/>
xpath>
field>record>

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Jan. 25
4121
1
Juni 21
5536
2
Feb. 19
5560
4
Nov. 16
7516
0
März 15
4253