close
In Odoo 14,how to set filters('*.pdf, *.jpg') in Binary field?

Users can only select the file with filter when uploading a file.

 

.py

related_file1 = fields.Binary(string='somefile’, attachment=True)

.xml

<field name="related_file1" widget="binary" options="{'accepted_file_extensions': '.pdf,.jpg'}"/>

arrow
arrow
    文章標籤
    odoo教學
    全站熱搜
    創作者介紹
    創作者 Akira Chen 的頭像
    Akira Chen

    akira32 編程之家 pixnet

    Akira Chen 發表在 痞客邦 留言(0) 人氣()