تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6542 أدوات العرض

After looking all over the internet (google included)

Combining this answers:

https://www.odoo.com/id_ID/forum/help-1/question/how-to-remove-field-from-the-measures-dropdown-in-pivot-and-graph-view-100340

and

https://www.odoo.com/de_DE/forum/hilfe-1/question/hide-fields-from-filter-in-odoo-12-171219

this is how i hide them:

@api.model
def fields_get(self, fields=None):
    hide = ['fieldname1','fieldname2']
    hide1 = ['fieldname3']
    hide2 = ['fieldname4']
    res = super(ClassName, self).fields_get()
    for field in hide:
        res[field]['selectable'] = False # to hide in Add Custom filter view
        res[field]['sortable'] = False # to hide in group by view
        res[field]['exportable'] = False # to hide in export list
        res[field]['store'] = False # to hide in 'Select Columns' filter in tree views
    for field in hide1:
        res[field]['exportable'] = False # to hide in export list
    for field in hide2:
        res[field]['selectable'] = False # to hide in Add Custom filter view
        res[field]['sortable'] = False # to hide in group by view
        res[field]['store'] = False # to hide in 'Select Columns' filter in tree views
    return res

was looking this for i don't know how long... 

but the question is from where do you get the attribute list? selectable, exportable...

الصورة الرمزية
إهمال
أفضل إجابة

Hi Andy,

in Odoo 14 the option 'exportable' is not defined but is checked in the function "fields_get" from the file "odoo/addons/web/controllers/main.py"

Following values are the default available options from an field in Odoo 14:

'change_default': Boolean,
'company_dependent': Boolean,
'depends': ...,
'manual': Boolean,
'readonly': Boolean,
'related': ...,
'required': Boolean,
'searchable': Boolean,
'sortable': Boolean,
'store': Boolean,

الصورة الرمزية
إهمال
الكاتب

Hi Nick, thank you for replying

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 22
8474
2
نوفمبر 23
3171
7
أبريل 21
20551
1
أكتوبر 20
4923
2
نوفمبر 16
4277