Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3468 Lượt xem

Hello All,

1) Go to Sale order Quotation

2) Click on 'Send By Email' button.

3) Pop will Open and Attachment will visible, ( If template have any kind of report attached )

4) Try to delete it.

you will get following error,

Uncaught TypeError: Cannot read property 'no_unlink' of undefined

Anyone Knows, how to solve it ?

This is very serious bug and it must need to solve. 

If anyone have already solved it then paste the solution over here, or if not, then I will do myself and will put the solution over here.

Waiting for answer of Expert !

 

 

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I have got something,

On file web/static/src/js/view_form.js, inside the class instance.web.form.FieldMany2ManyBinaryMultiFiles,

There is one method on_file_delete,

There is following code written,

    on_file_delete: function (event) {
        alert('testing deleting');
        event.stopPropagation();
        var file_id=$(event.target).data("id");
        if (file_id) {
            var files = _.filter(this.get('value'), function (id) {return id != file_id;});
            if(!this.data[file_id].no_unlink) {
                this.ds_file.unlink([file_id]);
            }
            this.set({'value': files});
        }
    },

If we remove this condition "if(!this.data[file_id].no_unlink)" then this error will solved.  

I am not sure why they have set no_unlink property.

What is usage of this ?

Anyone knows this ?

Ảnh đại diện
Huỷ bỏ

Your solution will not pop-up error, but also it will not unlink the file.

Câu trả lời hay nhất

Any serious bug should be reported on GitHub, not on this board. Although it is very nice of you to share code on how to solve the bug.

Ảnh đại diện
Huỷ bỏ