Ravi Gohil (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-381883-rgo into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #921572 in OpenERP Addons: "[6.0] CRM - email signature is taken from 
responsible instead of user"
  https://bugs.launchpad.net/openobject-addons/+bug/921572

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-381883-rgo/+merge/90670

Hello,

In CRM when you open the wizard to send an e-mail from an opportunity/lead 
communication, the default value of body text is set with the signature of the 
responsible instead of the connected user's.

This fix fixes the issue.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-381883-rgo/+merge/90670
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-381883-rgo.
=== modified file 'crm/crm.py'
--- crm/crm.py	2011-01-14 00:11:01 +0000
+++ crm/crm.py	2012-01-30 10:28:29 +0000
@@ -463,11 +463,8 @@
                     body = case.message_ids[0].description or ""
                 if not destination:
                     src, dest = dest, src
-                    if body and case.user_id.signature:
-                        if body:
-                            body += '\n\n%s' % (case.user_id.signature)
-                        else:
-                            body = '\n\n%s' % (case.user_id.signature)
+                    if case.user_id.signature:
+                        body += '\n\n%s' % (case.user_id.signature)
 
                 body = self.format_body(body)
 

=== modified file 'crm/wizard/crm_send_email.py'
--- crm/wizard/crm_send_email.py	2011-01-14 00:11:01 +0000
+++ crm/wizard/crm_send_email.py	2012-01-30 10:28:29 +0000
@@ -180,6 +180,7 @@
 
         user_obj = self.pool.get('res.users')
         user_mail_from = user_obj._get_email_from(cr, uid, [uid], context=context)[uid]
+        user_signature = user_obj.browse(cr, uid, uid).signature
 
         for case in mod_obj.browse(cr, uid, res_id, context=context):
             if 'email_to' in fields:
@@ -194,7 +195,7 @@
             if 'email_cc' in fields:
                 res.update({'email_cc': tools.ustr(case.email_cc or '')})
             if 'body' in fields:
-                res.update({'body': u'\n'+(tools.ustr(case.user_id.signature or ''))})
+                res.update({'body': u'\n' + tools.ustr(user_signature or '')})
             if 'state' in fields:
                 res.update({'state': u'pending'})
 
@@ -227,7 +228,7 @@
             if 'email_from' in fields:
                 res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or False})
 
-            signature = u'\n' + (tools.ustr(case.user_id.signature or '')) + u'\n'
+            signature = u'\n' + tools.ustr(user_obj.browse(cr, uid, uid).signature or '') + u'\n'
             original = [signature]
 
             if include_original == True and 'body' in fields:

_______________________________________________
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