Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

11

How do you add a header in a tree view?

By
AJ Schrafel Paper Corp
on 7/5/13, 7:32 PM 4,734 views

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

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.

Mackie Gippets
on 8/15/13, 12:53 AM

up voting a question you also want answered the the best way to promote it.

AJ Schrafel Paper Corp
on 8/15/13, 2:00 AM

@patently Didi you find any solution i also have same need

Anuradha
on 9/13/13, 3:04 AM
-4
Weste
On 4/4/14, 1:10 PM

Here is an example:

    <record id="view_computed_purchase_order_form" model="ir.ui.view">
        <field name="name">computed.purchase.order.form</field>
        <field name="model">computed.purchase.order</field>
        <field name="arch" type="xml">
            <form string="Computed Purchase Order" version="7.0">
                <sheet>
                    <header>
                        <button name="make_order" states="draft" string="Make Purchase Order" type="object" class="oe_highlight"/>
                        <button name="%(action_view_update_products)d" string="Update Products" type="action" class="oe_highlight" attrs="{'invisible':[('products_updated','=',False)]}"/>
                        <field name="state" widget="statusbar" statusbar_visible="draft,done,canceled" statusbar_colors='{"canceled":"red","done":"blue"}' readonly="1"/>
                    </header>
                        <group colspan="8" col="2">
                            <h1>
                                <label string="Computed Purchase Order" class="oe_title"/>
                                <field name="name" class="oe_inline" nolabel="1"/>
                            </h1>
                        </group>
                    <group col="7">
                        <group colspan="3" col="2">
                            <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
                        </group>
                        <field name="incoming_date"/>
                        <field name="purchase_order_id" states="done"/>
                        <field name="products_updated" invisible="1"/>
                        <field name="company_id" groups="base.group_multi_company"/>
                    </group>
                    ...
               </sheet>
            </form>
        </field>
     </record

tree view. Your example is for form view, the request is for tree view.

AJ Schrafel Paper Corp
on 4/4/14, 1:17 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/5/13, 7:32 PM
Seen: 4734 times
Last updated: 5/25/16, 4:53 AM