H. SLF
H. SLF

Reputation: 61

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?

Upvotes: 0

Views: 2301

Answers (1)

ChesuCR
ChesuCR

Reputation: 9670

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

Upvotes: 1

Related Questions