简体   繁体   中英

Odoo 12. why is there an error in view with xpath?

After migrate from odoo 10 to odoo 12 I have this error. In odoo this this code worked fine

<record model="ir.ui.view" id="creative_form">
  <field name="name">creative creative form</field>
  <field name="model">creative.creative</field>
  <field name="arch" type="xml">
    <form>
      <header>

      </header>
      <sheet>
        <notebook>
          <field name='test'/>
        </notebook>
      </sheet>
    </form>
  </field>
</record>


<record model="ir.ui.view" id="creative_form_for_manager">
  <field name="name">creative creative form for manager</field>
  <field name="model">creative.creative</field>
  <field name="inherit_id" ref="creative.creative_form"/>
  <field name="groups_id" eval="[(4, ref('creative.group_creative_manager'))]"/>
  <field name="arch" type="xml">
    <xpath expr="//notebook" position="replace"></xpath>
  </field>
</record>

The error looks like this:

Error : ValueError: Element '<xpath expr="//notebook">' cannot be located in parent view

you need to make sure the first part in the following line creative should exactly match the folder name of the module or what is called module technical name

<field name="inherit_id" ref="creative.creative_form"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM