Search code examples
odoo-8odoo-10odoo-9odoo

How to group or nest a tree view by a field in Odoo?


I want to create a nested tree view grouping by fields like the following image.

enter image description here

I did not find any source code within Odoo. How to do it?


Solution

  • When you create a search view with a group_by you can see the lines like that

    <record id="view_account_invoice_filter" model="ir.ui.view">
        <field name="name">account.invoice.select</field>
        <field name="model">account.invoice</field>
        <field name="arch" type="xml">
            <search string="Search Invoice">
                <filter string="Period" context="{'group_by':'period_id'}"/>
            </search>
        </field>
    </record>
    

    You must select it in the search view