Purnendu Singh (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-mail_improvement-psi into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-mail_improvement-psi/+merge/97803

Hello,

add a feature to call _hook_message_sent method of the related module which 
will trigger the workflow and set state accordingly

This improvement in mail module will satisfied the need of these branches 
requirements

https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-sale_order_wkf-psi/+merge/96300
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-Purchase_wkf-mma/+merge/96060

Thanks,
Purnendu Singh
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-mail_improvement-psi/+merge/97803
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-mail_improvement-psi.
=== modified file 'mail/mail_message.py'
--- mail/mail_message.py	2012-02-29 09:45:02 +0000
+++ mail/mail_message.py	2012-03-16 07:07:23 +0000
@@ -517,7 +517,9 @@
                     message.write({'state':'sent', 'message_id': res})
                 else:
                     message.write({'state':'exception'})
-
+                model_pool = self.pool.get(message.model)
+                if hasattr(model_pool, '_hook_message_sent'):
+                    model_pool._hook_message_sent(cr, uid, message.res_id, context=context)
                 # if auto_delete=True then delete that sent messages as well as attachments
                 message.refresh()
                 if message.state == 'sent' and message.auto_delete:

=== modified file 'mail/wizard/mail_compose_message.py'
--- mail/wizard/mail_compose_message.py	2012-02-22 11:25:55 +0000
+++ mail/wizard/mail_compose_message.py	2012-03-16 07:07:23 +0000
@@ -100,6 +100,7 @@
         if not result.get('email_from'):
             current_user = self.pool.get('res.users').browse(cr, uid, uid, context)
             result['email_from'] = current_user.user_email or False
+        result['subtype'] = 'html'
         return result
 
     _columns = {
@@ -158,8 +159,9 @@
                 if not (subject.startswith('Re:') or subject.startswith(re_prefix)):
                     subject = "%s %s" % (re_prefix, subject)
             result.update({
-                    'subtype' : 'plain', # default to the text version due to quoting
+                    'subtype' : message_data.subtype or 'plain', # default to the text version due to quoting
                     'body_text' : body,
+                    'body_html' : message_data.body_html,
                     'subject' : subject,
                     'attachment_ids' : [],
                     'model' : message_data.model or False,
@@ -238,7 +240,6 @@
                     subtype=mail.subtype, headers=headers, context=context)
                 # in normal mode, we send the email immediately, as the user expects us to (delay should be sufficiently small)
                 mail_message.send(cr, uid, [msg_id], context=context)
-
         return {'type': 'ir.actions.act_window_close'}
 
     def render_template(self, cr, uid, template, model, res_id, context=None):

=== modified file 'mail/wizard/mail_compose_message_view.xml'
--- mail/wizard/mail_compose_message_view.xml	2011-09-09 15:55:17 +0000
+++ mail/wizard/mail_compose_message_view.xml	2012-03-16 07:07:23 +0000
@@ -23,6 +23,7 @@
                     <notebook colspan="4">
                         <page string="Body">
                             <field name="body_text" colspan="4" nolabel="1" height="300" width="300"/>
+                            <field name="body_html" invisible="1"/>
                         </page>
                         <page string="Attachments">
                             <field name="attachment_ids" colspan="4" nolabel="1"/>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to