跳至內容
選單
此問題已被標幟
3 回覆
5268 瀏覽次數

att_file = fields.Binary(string='Attach File')

name="att_file" widget="binary" options="{'accept': '.pdf, image/*'}" filename="name" string="Attachment"/>

This is my Html code is any one can help me to specify the file input type.


頭像
捨棄
最佳答案

Hi,

Along with the field definition you can specify as follows:

options="{'accepted_file_extensions': '.pdf'}"


Sample: 

field name="worksheet_document" string="Document" options="{'accepted_file_extensions': '.pdf'}"


Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
9月 23
9970
1
2月 22
7050
2
7月 19
3058
0
11月 18
2990
4
9月 18
4993