Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
18231 Переглядів

I would like to add button into the view as in title.

There is a button box div and myButton must be placed inside of this box. 

...

<field name="" position="inside">

<button name="pick_one" class="oe_inline oe_stat_button" type="object" style="background:rgba(46, 210, 162,0.2);" string="- 1" icon="fa-sign-out" attrs="{'invisible':['|',('type', '=', 'service')]}"/>

</field>

...

How should I add it ?


Аватар
Відмінити
Найкраща відповідь

To add the button inside div,Please add the below code,


<xpath expr="//div[@name='buttons']" position="inside"> 

<button name="pick_one" class="oe_inline oe_stat_button" type="object" style="background:rgba(46, 210, 162,0.2);" string="- 1" icon="fa-sign-out" attrs="{'invisible':['|',('type', '=', 'service')]}"/>

</xpath>

Аватар
Відмінити
Автор

Awesome, thank you Nilesh :) AssertionError: Did not expect element xpath there, line 9 Where should I add it in xml file ? to avoid this error ?

Автор

OK, i got it :)

Автор

Done :)

Автор

By any chance can I decide where to put it I mean above or below existing buttons ?

Yes, you can decide where to add button. Inside means Button added after the other existing buttons. If you need to add button after/before particular existing button, then you have to use xpath like(example) <xpath expr="//div[@name='buttons']/button[@name='action_open_quants']" position="after"> You can use position after, before or inside. 'action_open_quants' is the name of the button.

Автор

Got it, THANK YOU! Nilesh