コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
5531 ビュー

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?


アバター
破棄
最善の回答

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

アバター
破棄
最善の回答

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 ?

アバター
破棄
著作者

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

著作者

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

関連投稿 返信 ビュー 活動
1
7月 22
3987
2
3月 23
14388
2
2月 23
1790
2
9月 15
5399
1
3月 15
3584