diff options
| author | Thibault Delavallée <tde@openerp.com> | 2014-03-14 18:12:13 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-03-14 18:12:13 +0100 |
| commit | 4b5b4e86d71b08b00606f10dc280e36da3c9050d (patch) | |
| tree | c9cdb377c637baaad46a9b6d9715b6ef12e43e7b /addons/mail/mail_message.py | |
| parent | 4ef08f78a03bb9c835feca0926a8e83568efe0cd (diff) | |
[REM] mail_message: removed dead code: quote context is not planned
to be used anymore.
bzr revid: tde@openerp.com-20140314171213-0v3t7c1akbviu99e
Diffstat (limited to 'addons/mail/mail_message.py')
| -rw-r--r-- | addons/mail/mail_message.py | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 671309cd3ee..eca19d58f87 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -886,78 +886,6 @@ class mail_message(osv.Model): # Messaging API #------------------------------------------------------ - # TDE note: this code is not used currently, will be improved in a future merge, when quoted context - # will be added to email send for notifications. Currently only WIP. - MAIL_TEMPLATE = """<div> - % if message: - ${display_message(message)} - % endif - % for ctx_msg in context_messages: - ${display_message(ctx_msg)} - % endfor - % if add_expandable: - ${display_expandable()} - % endif - ${display_message(header_message)} - </div> - - <%def name="display_message(message)"> - <div> - Subject: ${message.subject}<br /> - Body: ${message.body} - </div> - </%def> - - <%def name="display_expandable()"> - <div>This is an expandable.</div> - </%def> - """ - - def message_quote_context(self, cr, uid, id, context=None, limit=3, add_original=False): - """ - 1. message.parent_id = False: new thread, no quote_context - 2. get the lasts messages in the thread before message - 3. get the message header - 4. add an expandable between them - - :param dict quote_context: options for quoting - :return string: html quote - """ - add_expandable = False - - message = self.browse(cr, uid, id, context=context) - if not message.parent_id: - return '' - context_ids = self.search(cr, uid, [ - ('parent_id', '=', message.parent_id.id), - ('id', '<', message.id), - ], limit=limit, context=context) - - if len(context_ids) >= limit: - add_expandable = True - context_ids = context_ids[0:-1] - - context_ids.append(message.parent_id.id) - context_messages = self.browse(cr, uid, context_ids, context=context) - header_message = context_messages.pop() - - try: - if not add_original: - message = False - result = MakoTemplate(self.MAIL_TEMPLATE).render_unicode(message=message, - context_messages=context_messages, - header_message=header_message, - add_expandable=add_expandable, - # context kw would clash with mako internals - ctx=context, - format_exceptions=True) - result = result.strip() - return result - except Exception: - _logger.exception("failed to render mako template for quoting message") - return '' - return result - def _notify(self, cr, uid, newid, context=None, force_send=False, user_signature=True): """ Add the related record followers to the destination partner_ids if is not a private message. Call mail_notification.notify to manage the email sending |
