Odoo Help


Issue in many2many_binary widget unable to delete the attachment?..

on 7/14/14, 2:24 AM 2,618 views

In the custom module odoo version 7 Form view added many2many attachment_ids :-


'attachment_ids': fields.many2many('ir.attachment', 'sample_ir_attachments_rel', 'sample_id', 'attachment_id','Attachments'),

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

When deleting document in a many2many field with widget="many2many_binary"  its still shows in the form view and attachemnt not deleted in database. How to fix this issue in version 7?. If already fixed please give me the File changes difference.

In Openerp version 7 is any other custom widget code available for Attach Files? (more than one file). Default many2many_binary issues to delete attachment and view delete icon.

on 7/19/14, 6:15 AM
On 8/14/14, 11:58 PM

HI, I get the same problem.

I  find one solution to solve it. 


Open file view_form.js (../addons/web/static/src/js/view_form.js)  , Then find this code

   on_file_delete: function (event) {
        var file_id=$(event.target).data("id");
        if (file_id) {
            var files=[];
            for(var i in this.get('value')){
                if(file_id != this.get('value')[i].id){
                else if(!this.get('value')[i].no_unlink) {    #  remove '!'  then delete method will be ok
            this.set({'value': files});

near line 5348

Thank you for your help

on 8/29/14, 1:43 AM

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 7/14/14, 2:24 AM
Seen: 2618 times
Last updated: 3/16/15, 8:10 AM