[IMP] mail: filter has attachment
bzr revid: chm@openerp.com-20121024144135-frzyxty5iiksqtg4
This commit is contained in:
@@ -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')]"/>
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user