Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
27754 Widoki

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

Awatar
Odrzuć

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.

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

Ok thanks Grover, it's run

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

Autor Najlepsza odpowiedź

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

Awatar
Odrzuć

Thank you @ Malle.

+1

Powiązane posty Odpowiedzi Widoki Czynność
1
lip 18
4570
6
gru 23
17907
1
cze 23
3310
5
sty 23
16532
2
lut 20
14851