Skip to Content
Menu
This question has been flagged
2 Replies
3936 Views

I am extending the standard event.booth module with my custom module. I am trying to add pages to the "Registrations" Notebook the event.booth form has. Unfortunately tho, i cant select the existing notebook with xpath because it also gets added through a second module (called event_booth_sale).

Here are my attempts

<record id="view_booth_form_inherit" model="ir.ui.view">
<field name="name">event.booth.inheritfield>
<
field name="model">event.boothfield>
<
field name="inherit_id" ref="event_booth.event_booth_view_form_from_event">field>
<
field name="priority">20field>
<
field name="arch" type="xml">
<xpath expr="//sheet" position="inside">
<notebook>
<page string="Allgemein">
<group>
...

group>

page>
<
page string="Wände">
<group col="4">
...
group>
page>
notebook>
xpath>
<
xpath expr="//sheet" position="inside">
<field name="plan" widget="image"/>
xpath>
field>
record>

This also doesnt work:

<record id="view_booth_form_inherit" model="ir.ui.view">
<field name="name">event.booth.inheritfield>
<
field name="model">event.boothfield>
<
field name="inherit_id" ref="event_booth.event_booth_view_form_from_event">field>
<
field name="priority">20field>
<
field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Allgemein">
<group>
...

group>

page>
<
page string="Wände">
<group col="4">
...

group>
page>
notebook>
xpath>
field>
record>

This is almost always the result:


As you can see, there are two notebooks instead of one. I dont know what to do in order to combine them.

I also tried adding 

groups="base.group_no_one"

to the notebook, same results.

Does anyone know how to do this?


Avatar
Discard
Best Answer

Hi  Josef,

Try inheriting 'event_booth_sale.event_booth_view_form_from_event'

<record id="event_booth_view_form_from_event_add_page" model="ir.ui.view">
<field name="name">event.booth.view.form.inherit.notebookfield>
<
field name="model">event.boothfield>
<
field name="inherit_id" ref="event_booth_sale.event_booth_view_form_from_event"/>
<
field name="priority">5field>
<
field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="your_page_name" string="your_page_string">

page>
xpath>
field>
record>

 And add 'event_booth_sale' in depends on your custom modules manifest file.


Hope it helps,
Kiran K

Avatar
Discard
Best Answer

You should be able to target the existing notebook using xpath if it is there ..

//notebook[@id='registration']

Did you add the event_booth_sale module that introduces the notebook as a dependency to your new module ?

Avatar
Discard
Author

Unfortunately I get this error:
Element '<xpath expr="//notebook[@id=&#39;registration&#39;]">' kann nicht in der übergeordneten Ansicht lokalisiert werden

which translates to the given xpath could not be found in its parent view.

I did add event_booth_sale to the depends key in the manifest.
Thank you for your comment.

IN your second example change the inherit_id to :

event_booth_sale.event_booth_view_form_from_event

That is the one that has the notebook

Author

Inheriting from event_booth_sale solved the problem! Thank you Jaco Waes!

Related Posts Replies Views Activity
1
Jul 22
2832
2
Mar 23
9976
2
Feb 23
675
2
Sep 15
4241
1
Mar 15
2660