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

Hi, I am creating attachment file(upload documents) in my module. I have created successfully created "upload features" using binary field in following way.

xml:

<field name="file_upload">

Python:

'file_upload':fields.binary('Documents')

Here When I click select button My directory will be opened, then i need choose file. But i want these process is doing automatically. That means When I click save button to save a record, documents should be attached automatically.

I tried many way but still I can not get. pls anyone answer this question,.

Ảnh đại diện
Huỷ bỏ

Anything on this ?

Câu trả lời hay nhất

Python:


binary_field = fields.Binary(string = 'File')

file_name = fields.Char(string = 'Filename')

And in the form view in your XML:

filename="file_name"/>


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 24
17270
2
thg 12 23
25357
1
thg 3 15
3412
1
thg 3 15
4144
0
thg 3 15
3917