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

.py Code : 

'attachment_ids': fields.many2many('ir.attachment', 'project_issue_ir_attachments_rel', 'issue_id', 'attachment_id', 'Attachments'),


.xml Code : 

<field name="attachment_ids" widget="many2many_binary" string="File"/>

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

Hi Manish Kumar Bohra,

you can use the widget, widget="many2many_kanban" for that.
but you have some extra steps in the attachment adding stage.

1. Add the attachment.



2. Create or Select one item from the wizard(ir.attachment model)


3. If you are creating, you have to give name, file in the wizard.



4. Then you will get this type of form view.




Note: In my knowledge, you can't delete an attachment you are uploaded. but you can change the name and file.

Hope this will help you.

Thank you.

Ảnh đại diện
Huỷ bỏ
Tác giả

but can you suggest any solution to delete these uploaded files ??

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

in which version this code working?

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

Thank  you Avinash it's working .

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

hey , I use it for odoo v11 but it does not work :(((  
Do you have a solution?

Ảnh đại diện
Huỷ bỏ
Tác giả

which kind of problem you are facing ?

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 17
3975
0
thg 8 16
4347
0
thg 4 16
128
0
thg 12 15
6829
5
thg 11 15
5707