[IMP] mail: fix attachment error

bzr revid: chm@openerp.com-20121207084610-979a5om26shed1ak
This commit is contained in:
Christophe Matthieu 2012-12-07 09:46:10 +01:00
parent 1737ac04f2
commit 84ac690b92
1 changed files with 3 additions and 6 deletions

View File

@ -422,12 +422,11 @@ openerp.mail = function (session) {
on_attachment_loaded: function (event, result) {
if (result.erorr || !result.id ) {
this.do_warn(result.title, result.erorr);
var error_title = result.error.split('\n')[0];
var error_content = result.error.replace(/^.*\n/, '');
this.do_warn(error_title, error_content);
this.attachment_ids = _.filter(this.attachment_ids, function (val) { return !val.upload; });
} else {
for (var i in this.attachment_ids) {
if (this.attachment_ids[i].filename == result.filename && this.attachment_ids[i].upload) {
this.attachment_ids[i]={
@ -438,10 +437,8 @@ openerp.mail = function (session) {
};
}
}
}
this.display_attachments();
var $input = this.$('input.oe_form_binary_file');
$input.after($input.clone(true)).remove();
this.$(".oe_attachment_file").show();