This question has been flagged
3 Replies
11209 Views

How to group by in one2many tree view

Avatar
Discard
Best Answer

please try ,

<record id="search_mail_partner_ids" model="ir.ui.view">

    <field name="name">Channel Search</field>

    <field name="model">Your one2many model</field>

    <field name="arch" type="xml">

    <search>

       <group expand="0" name="group_by" string="Group By">

            <filter name="field name" string="string" domain ="[('xxx','yy',zz)]" context="{'group_by':'field name'}" />

        </group>

    </search> 

    </field>

</record>

Avatar
Discard

Hello @Hilar,

Can we apply group by on one2many filed in side form view like sale order line product group by according to product name?

Best Answer

You mean you have to arrange the fields of one2many ?. Then you should give a view to the one2many object. Then in xml file, give the record id into form_view_ref as context. I think this is the solution (Question is not descriptive, If you clear the question, It may helpfull)

Avatar
Discard
Author Best Answer

Something like this:


<field name="one2many_ids">

     <tree>

         <field name="field1"/>

         <field name="field2"/>

    </tree>

</field>


I want to use group by in tree view but I don't know how

Avatar
Discard

Hello I am Facing similar problem you have find any solution related this problem ?

have you got the answer ?