[IMP] mail: filter has attachment

bzr revid: chm@openerp.com-20121024144135-frzyxty5iiksqtg4
This commit is contained in:
Christophe Matthieu
2012-10-24 16:41:35 +02:00
parent 4ce75bb9bd
commit 7b6cc50de7
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -63,6 +63,9 @@
<filter string="Comments"
name="comments" help="Comments"
domain="[('type', '=', 'comment')]"/>
<filter string="Has attachments"
name="attachments"
domain="[('attachment_ids', '!=', False)]"/>
<filter string="Notifications"
name="notifications" help="Notifications"
domain="[('type', '=', 'notification')]"/>
+2 -2
View File
@@ -637,14 +637,14 @@ openerp.mail = function(session) {
for (var l in this.attachment_ids) {
var attach = this.attachment_ids[l];
attach['url'] = mail.ChatterUtils.get_attachment_url(this.session, attach);
if((attach.filename || attach.name).match(/[.](jpg|jpg|gif|png|tif|svg)$/i)) {
attach.is_image = true;
}
if((attach.filename || attach.name).match(/[.](pdf|doc|docx|xls|xlsx|ppt|pptx|psd|tiff|dxf|svg)$/i)) {
attach.is_document = true;
attach.url_escape = escape(attach.url);
attach.url_escape = escape(encodeURI(attach.url));
}
}