Skip to Content
Menu
This question has been flagged
2 Replies
5730 Rodiniai

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?


Portretas
Atmesti
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

Portretas
Atmesti
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 ?

Portretas
Atmesti
Autorius

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

Autorius

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

Related Posts Replies Rodiniai Veikla
1
liep. 22
4095
2
kov. 23
14817
2
vas. 23
1946
2
rugs. 15
5579
1
kov. 15
3729