İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
8498 Görünümler

Hello everyone,

I need your help on hiding some technical fields from filter options under search views and if possible from the "Export" option available on the system in Odoo 12.


Please refer to the following images for a better understanding of my needs.

https://ibb.co/2yTjzwx

https://ibb.co/0YP6pS0


The first image is from filters option from search views and the second is from Odoo standard Export form available on several models.

Based on the above images, I want to hide some of the available fields.

Is there any way I can achieve that?

Thank you very much in advance

Best regards

PM

Avatar
Vazgeç

Try this method to hide fields from Filters.

    @api.model

    def fields_get(self, fields=None):

        hide = ['field 1','field 2','field 3']

        res = super(ClassName, self).fields_get()

        for field in hide:

            res[field]['selectable'] = False

        return res

En İyi Yanıt

Hi  Paulo Matos,

@api.model
def fields_get(self, fields=None):
hide = ['field 1','field 2','field 3']
res = super(ClassName, self).fields_get()
for field in hide:
res[field]['selectable'] = False // To Hide Field From Filter
res[field]['sortable'] = False // To Hide Field From Group by
        res[field]['exportable'] = False // To Hide Field From Export List
    return res

Hope it helps,

Kiran K

Avatar
Vazgeç
En İyi Yanıt
'selectable' property doesn't seem to be available in Odoo15. Any other way to do this??  
res[field]['selectable']


Avatar
Vazgeç

Hi Kiran S,
the option "selectable" was replaced with the value "searchable". For more details of the field options you can check my comment in following post: https://www.odoo.com/de_DE/forum/hilfe-1/attribute-list-of-hide-export-list-filter-list-group-by-list-in-fields-get-178590

Thanks Nick! This is helpful :)

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Tem 22
6552
5
Mar 25
15790
1
Eki 22
4293
7
Mar 17
13872
1
May 25
1731