Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
27679 Visualizzazioni

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...

Avatar
Abbandona

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.

Risposta migliore

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.

Avatar
Abbandona
Autore

Ok thanks Grover, it's run

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

Autore Risposta migliore

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"/>

Avatar
Abbandona

Thank you @ Malle.

+1

Post correlati Risposte Visualizzazioni Attività
1
lug 18
4515
6
dic 23
17847
1
giu 23
3259
5
gen 23
16461
2
feb 20
14798