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

Hi all, I just started developing with odoo and I have a few questions: 

Is it possible to make a group of filters like it is implemented with date?

If it is possible to make a group, then I have several documents with the same number and can I make a filter so that I have all the available numbers in the group so that I can make a filter by them?

For example:

Document number Title

111                            Case of...

123                           something else

111                            an appendix to the case

.

.

.

Ảnh đại diện
Huỷ bỏ

My first answer is yes, it's possible but it's not very clear what you wanna do or solve

Câu trả lời hay nhất

Yes, it is possible to create a group of filters in Odoo. These groups of filters are referred to as "filter groups" in Odoo's user interface. They are commonly used to organize filters and make it easier for users to find relevant filters for specific scenarios.

To create a filter group, you can follow these steps:

Go to the list view of the model you want to add the filter group to (e.g., Sales Orders, Purchase Orders, etc.).
Click on the "Filters" dropdown in the top right corner of the list view.
Click on the "Manage Filters" option.
In the new window that appears, you'll find a button to "Create" a new filter group. Give it a name and click "Save."
 
Filter by Document Numbers:
If you have several documents with the same number and you want to create a filter that shows all available numbers in the group- you can use the domain like [('field_name', '=', 'your_document_number')]
or you can try this method

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

<field name="name">my.custom.model.search</field>

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

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

        <search>

            <!-- Add the custom search filter for document numbers -->

            <filter string="All Document Numbers" domain="[]" help="Filter by Document Numbers" context="{'group_by': 'name'}"/>

        </search>

    </field>

</record>



Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 22
3317
0
thg 4 18
2963
0
thg 2 23
5788
2
thg 1 22
2746
1
thg 9 16
56