I want to add a header with buttons to a tree view. How can I do that?
The normal <header> tag does not work.
Can someone point me to a module that does this or give me an example of the XML i need to include?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to add a header with buttons to a tree view. How can I do that?
The normal <header> tag does not work.
Can someone point me to a module that does this or give me an example of the XML i need to include?
Thanks
Hello @AJ,
1) If u want to place a button in tree view's header eg. beside Create Button then the below link can help:
2) If u want to place a button in tree view then below code can help:
<record id="view_categ_tree" model="ir.ui.view">
<field name="name">categ.tree</field>
<field name="model">categ</field>
<field name="arch" type="xml">
<tree string="Category" editable="bottom">
<button name="action_dosomething" string="Demo Button" type="object" class="btn-primary"/>
<field name="name" required="1"/>
</tree>
</field>
</record>
Regards,
Email: odoo@aktivsoftware.com
Hi,
In the latest versions, if you need to add button to the list view, it is easy as we do in the form, just add header tag and inside it is possible to define buttons.
Sample:
<record id="res_lang_tree" model="ir.ui.view">
<field name="name">res.lang.treefield>
<field name="model">res.langfield>
<field name="arch" type="xml">
<tree string="Languages" limit="200">
<header>
<button name="action_activate_langs" type="object" string="Activate"/>
header>
Thanks
You can add a header with buttons to a Tree View in Odoo by using xPath expressions.
First of all, you will have to define your header in the XML file which defines the Tree View-
Then, use xPath expressions to position the button on the TreeView-
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
Highlight Records in Tree
Solved
|
|
3
May 23
|
1675 | |
|
1
Apr 23
|
3164 | ||
|
1
Aug 19
|
6184 | ||
|
1
Sep 18
|
10255 | ||
|
0
Mar 17
|
2231 |
I would also like to find out how to do this as well. When I insert
<tree>
inside<group>
tag it still draws the elements as form and not as tree.up voting a question you also want answered the the best way to promote it.
@patently Didi you find any solution i also have same need
I dont know if we can do it by xml. but you can do it by modifying listview.js