Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Attach many files in a binary field type

By
MALLE SOULEYMANE
on 11/28/13, 8:35 AM 4,250 views

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.

Ayyappan
on 11/28/13, 8:47 AM
1

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 11/28/13, 10:10 AM

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

MALLE SOULEYMANE
on 11/28/13, 11:34 AM

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

GH Mediacloud, Grover Menacho
on 11/28/13, 4:49 PM
2
MALLE SOULEYMANE
On 11/29/13, 4:03 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/28/13, 8:35 AM
Seen: 4250 times
Last updated: 3/16/15, 8:10 AM