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

Hi, I want to know how can I choose many file in my PC to my application, like the field binary but I don't want one file, I would like to add many file. Thank you for answer...

頭像
捨棄

I think we can't save multiple file in single field. So use 2 classes with one2many relation. In child class we add binary field for multiple file should be chosen.

最佳答案

You can see it on message module:

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

You can find it here: /mail/wizard/mail_compose_message_view.xml

It handles that with qweb, but it's a little bit complex.

Anyways you can look this as an example to do this.

頭像
捨棄
作者

Ok thanks Grover, it's run

Did you made it run? Awesome, i'll try later

作者 最佳答案

I put this inmy class.py 'attachment_ids': fields.many2many('ir.attachment', 'class_ir_attachments_rel', 'class_id', 'attachment_id', 'Attachments'), and this in my class_view.xml <field name="attachment_ids" widget="many2many_binary"/>

頭像
捨棄

Thank you @ Malle.

+1

相關帖文 回覆 瀏覽次數 活動
1
7月 18
4519
6
12月 23
17851
1
6月 23
3270
5
1月 23
16470
2
2月 20
14801