[IMP] attachments on messages
bzr revid: fp@tinyerp.com-20140316113742-odae0ph3a1qrqn12
This commit is contained in:
parent
9d9e6007fe
commit
675a71b2b8
|
@ -88,7 +88,7 @@ def slug(value):
|
|||
else:
|
||||
# assume name_search result tuple
|
||||
id, name = value
|
||||
slugname = slugify(name)
|
||||
slugname = slugify(name or '')
|
||||
if not slugname:
|
||||
return str(id)
|
||||
return "%s-%d" % (slugname, id)
|
||||
|
|
|
@ -66,8 +66,11 @@ class MailGroup(http.Controller):
|
|||
)
|
||||
thread_ids = thread_obj.search(cr, uid, domain, limit=self._thread_per_page, offset=pager['offset'])
|
||||
|
||||
messages = thread_obj.browse(cr, uid, thread_ids, context)
|
||||
for m in messages:
|
||||
print m.subject
|
||||
values = {
|
||||
'messages': thread_obj.browse(cr, uid, thread_ids, context),
|
||||
'messages': messages,
|
||||
'group': group,
|
||||
'pager': pager,
|
||||
'mode': mode
|
||||
|
|
|
@ -94,6 +94,23 @@
|
|||
on <span t-field="message.date"/>
|
||||
</h4>
|
||||
<div t-raw="message.body"/>
|
||||
|
||||
<div class="row" t-if="message.attachment_ids">
|
||||
<h3 class="col-sm-12">Attachment(s):</h3>
|
||||
<div class="col-md-2 col-sm-3 text-center" t-foreach='message.attachment_ids' t-as='attachment'>
|
||||
<a t-att-href="'/mail/download_attachment?model=mail.message&id='+str(message.id)+'&method=download_attachment&attachment_id='+str(attachment.id)" target="_blank">
|
||||
<t t-if="attachment.file_type == 'webimage'">
|
||||
<img t-att-src="'/web/binary/image?model=ir.attachment&field=datas&id=' + str(attachment.id) + '&resize=100,80'"
|
||||
class='oe_attachment_embedded'></img>
|
||||
</t>
|
||||
<t t-if="attachment.file_type != 'webimage'">
|
||||
<img t-att-src="'/mail/static/src/img/mimetypes/' + attachment.file_type + '.png'"
|
||||
class='oe_attachment_webimage'></img>
|
||||
</t>
|
||||
<div class='oe_attachment_name'><t t-raw='attachment.name' /></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div t-if="message.child_ids">
|
||||
<h2 class="page-header">Follow ups</h2>
|
||||
<t t-set="messages" t-value="message.child_ids"/>
|
||||
|
|
Loading…
Reference in New Issue