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

Hi,

I have a custom module in odoo8 called "DMR". In this, I have a Tree View:

 

I would like to add a "Group By" feature next to "Favorites" and "Filters", to group by a combination of 1. Customer 2. Defect Code 3.Disposition Code. 4.Date 5.Process

Is there any documentation to help me out here?

Thank you.

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

Hello Alex,


For add group by, you need to add search view in the xml file.

For Ex :-


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

    <field name="name">dmr.search.view</field>   

    <field name="model">model.name</field>   

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

        <search string="DMR">           

            <filter name="group_customer_id" string="Customer" icon="terp-partner" context="{'group_by':'field_name'}"/>       

        </search>   

    </field>

</record>


After adding search record, you need to add search_view_id in action.

For Ex :-

In action,

<field name="search_view_id" ref="dmr_search_view"/>


Hope it works for you.

Thanks,

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

Hi,

You need to define search view for your model.

Below link will help you-

\http://www.odoo.com/documentation/9.0/reference/views.html#search

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

Thank you but how can I group a date by month?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 23
2701
1
thg 8 21
11260
2
thg 1 24
14943
1
thg 2 25
20855
0
thg 3 15
5627