Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8470 Lượt xem

Hi,


how can I create a new group in form tree ?

in a form tree, I have "filters", "group" and "favorites", how can I add a custom group ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

check the below code it will give you an idea how to group

<record id="view_student_search" model="ir.ui.view">
<field name="name">student.student.search</field>
<field name="model">student.student</field>
<field name="priority" eval="8" />
<field name="arch" type="xml">
<search string="Student">
<field name="name" />
<field name="blood_group" />
<newline />
<group expand="0" string="Group By...">
<filter name="blood_group" string="Blood Group"
domain="[]" context="{'group_by':'blood_group'}" />
<filter name="course_id" string="Course"
domain="[]" context="{'group_by':'course_id'}" />
</group>
</search>
</field>
</record>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

This is sample code that shows how the group by works.
<record id="view_lmc_phone_filter" model="ir.ui.view">
            <field name="name">lmc.phone.search</field>
            <field name="model">lmc.phone</field>
            <field name="arch" type="xml">
                <search string="Search lmc phone">
                    <field name="state"/>
                    <filter string="To Do(Scheduled)" name="state" domain="[('state','in',('new','in_progress'))]" context="{'group_by':'activity_type'}"/>
     <filter string="Status" domain="[('state','in',('new','in_progress'))]" context="{'group_by': 'state'}"/>
               </search>
            </field>
        </record>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 15
10161
0
thg 5 15
3670
3
thg 7 24
25207
3
thg 5 24
4122
1
thg 12 19
4773