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

I am making some modifications for a migration from Odoo 14 to 17 but in the odoo 14 code there are some model fields that have the filters parameter, for example:

file = fields.Binary('File', filters='.xls')


but I don't understand what that code does since in 17 it returns warnings for that parameter,

does this do anything??? And in case it works for me, how can I use it in version 17???

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Please check the code below:

Python:

file = fields.Binary('File')

XML:

<field name="file"  options="{'accepted_file_extensions': '.xls'}"/>

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
0
thg 7 15
3806
1
thg 10 18
15356
1
thg 4 19
5394
1
thg 4 15
6907
2
thg 3 15
5726