From 864ff38236e09d468623b3c3700e9a87e0c10d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 7 Mar 2013 16:32:16 +0100 Subject: [PATCH 01/20] [IMP] CRM: when processing incoming emails to create a lead, do not add the email content as description. bzr revid: tde@openerp.com-20130307153216-hab124jnmcmj3dm8 --- addons/crm/crm_lead.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index e5d07b2df42..e8bba67e1ce 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -975,12 +975,10 @@ class crm_lead(base_stage, format_address, osv.osv): through message_process. This override updates the document according to the email. """ - if custom_values is None: custom_values = {} - - desc = html2plaintext(msg.get('body')) if msg.get('body') else '' + if custom_values is None: + custom_values = {} defaults = { 'name': msg.get('subject') or _("No Subject"), - 'description': desc, 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'partner_id': msg.get('author_id', False), From b551e04dcdf34f2ade1cbb8cdc4ba0b16f0a628e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 7 Mar 2013 17:28:51 +0100 Subject: [PATCH 02/20] [IMP] CRM: phonecall scheduling: opportunity description not in phonecall description anymore; move a field in form view to be more user friendly. bzr revid: tde@openerp.com-20130307162851-jmic921ixzjop44g --- addons/crm/wizard/crm_opportunity_to_phonecall.py | 2 -- addons/crm/wizard/crm_opportunity_to_phonecall_view.xml | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall.py b/addons/crm/wizard/crm_opportunity_to_phonecall.py index ad9d30c80a4..ee7ed1fc31f 100644 --- a/addons/crm/wizard/crm_opportunity_to_phonecall.py +++ b/addons/crm/wizard/crm_opportunity_to_phonecall.py @@ -52,8 +52,6 @@ class crm_opportunity2phonecall(osv.osv_memory): res.update({'categ_id': categ_id}) if 'partner_id' in fields: res.update({'partner_id': opp.partner_id and opp.partner_id.id or False}) - if 'note' in fields: - res.update({'note': opp.description}) if 'contact_name' in fields: res.update({'contact_name': opp.partner_id and opp.partner_id.name or False}) if 'phone' in fields: diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml index 6e44573cc89..ad369448517 100644 --- a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml +++ b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml @@ -13,14 +13,14 @@ + - From 2da3ea2d628d070e19db4dd172e3b2445fccad3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 7 Mar 2013 17:50:14 +0100 Subject: [PATCH 03/20] [IMP] email_template: added _order as name. bzr revid: tde@openerp.com-20130307165014-gv2gmfh9d1nvjy9h --- addons/email_template/email_template.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 743384059b4..280e44fa2fb 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -65,6 +65,7 @@ class email_template(osv.osv): "Templates for sending email" _name = "email.template" _description = 'Email Templates' + _order = 'name' def render_template(self, cr, uid, template, model, res_id, context=None): """Render the given template text, replace mako expressions ``${expr}`` From 2a849670f498d5c673b1f56cca5ebe7a57b79922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 7 Mar 2013 17:50:45 +0100 Subject: [PATCH 04/20] [IMP] email_template: from and subject are not required anymore, because they can have now defautl values using chatter. bzr revid: tde@openerp.com-20130307165045-dihvsdo3whgsk05b --- addons/email_template/email_template_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/email_template/email_template_view.xml b/addons/email_template/email_template_view.xml index 4cddb31c8e1..73e796394a8 100644 --- a/addons/email_template/email_template_view.xml +++ b/addons/email_template/email_template_view.xml @@ -28,7 +28,7 @@ - + @@ -43,7 +43,7 @@ - + From 5ebf390f965f369bc4c29c7e5cf4232480d34bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 10:11:56 +0100 Subject: [PATCH 05/20] [FIX] email_template: void value in partner_ids when generating tmeplate does not erase wizard value anymore. bzr revid: tde@openerp.com-20130308091156-ytw5k4y5w321705f --- .../wizard/mail_compose_message.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index b39ed4e5639..e9f539a22b2 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -70,6 +70,7 @@ class mail_compose_message(osv.TransientModel): elif template_id: # FIXME odo: change the mail generation to avoid attachment duplication values = self.generate_email_for_composer(cr, uid, template_id, res_id, context=context) + print values.get('partner_ids') # transform attachments into attachment_ids values['attachment_ids'] = [] ir_attach_obj = self.pool.get('ir.attachment') @@ -80,7 +81,7 @@ class mail_compose_message(osv.TransientModel): 'datas_fname': attach_fname, 'res_model': model, 'res_id': res_id, - 'type': 'binary', # override default_type from context, possibly meant for another model! + 'type': 'binary', # override default_type from context, possibly meant for another model! } values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context)) else: @@ -125,19 +126,22 @@ class mail_compose_message(osv.TransientModel): fields = ['body_html', 'subject', 'email_to', 'email_recipients', 'email_cc', 'attachments'] values = dict((field, template_values[field]) for field in fields if template_values.get(field)) values['body'] = values.pop('body_html', '') - # transform email_to, email_cc into partner_ids - values['partner_ids'] = [] + # transform email_to, email_cc into partner_ids + partner_ids = set() mails = tools.email_split(values.pop('email_to', '') + ' ' + values.pop('email_cc', '')) for mail in mails: partner_id = self.pool.get('res.partner').find_or_create(cr, uid, mail, context=context) - values['partner_ids'].append(partner_id) + partner_ids.add(partner_id) email_recipients = values.pop('email_recipients', '') if email_recipients: for partner_id in email_recipients.split(','): - values['partner_ids'].append(int(partner_id)) - - values['partner_ids'] = list(set(values['partner_ids'])) + if partner_id: # placeholders could generate '', 3, 2 due to some empty field values + partner_ids.add(int(partner_id)) + # legacy template behavior: void values do not erase existing values and the + # related key is removed from the values dict + if partner_ids: + values['partner_ids'] = [(6, 0, list(partner_ids))] return values From 22bba15ccd7ab709db9ed2c38a132273c9847e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:43:41 +0100 Subject: [PATCH 06/20] [FIX] email_template: on_change values for m2m can be list of ids, not necessarily commands. bzr revid: tde@openerp.com-20130308124341-ih0f4us81cffer7m --- addons/email_template/wizard/mail_compose_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index e9f539a22b2..9dad18e07f3 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -141,7 +141,7 @@ class mail_compose_message(osv.TransientModel): # legacy template behavior: void values do not erase existing values and the # related key is removed from the values dict if partner_ids: - values['partner_ids'] = [(6, 0, list(partner_ids))] + values['partner_ids'] = list(partner_ids) return values From 6dbb52267f514055f013207f7522f9d49dfd6110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:47:24 +0100 Subject: [PATCH 07/20] [FIX] res_partner: notification_email_send help and selection values strings updated for cleaner explanations. bzr revid: tde@openerp.com-20130308124724-6tmb4w180sf32ktb --- addons/mail/res_partner.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 218b5ae3cb7..6807c13a08a 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -30,13 +30,16 @@ class res_partner_mail(osv.Model): _columns = { 'notification_email_send': fields.selection([ - ('all', 'All feeds'), - ('comment', 'Comments and Emails'), - ('email', 'Emails only'), + ('all', 'All Messages (discussions, emails, followed system notifications)'), + ('comment', 'Incoming Emails and Discussions'), + ('email', 'Incoming Emails only'), ('none', 'Never') - ], 'Receive Feeds by Email', required=True, - help="Choose in which case you want to receive an email when you "\ - "receive new feeds."), + ], 'Receive Messages by Email', required=True, + help="Policy to receive emails for new notifications pushed to your Inbox. "\ + "'Never' prevents OpenERP from sending emails for notifications. "\ + "'Incoming Emails only' send an email when you receive an incoming email, such as customer replies. "\ + "'Incoming Emails and Discussions' sends emails for incoming emails along with user input. "\ + "'All Messages' also sends emails for notifications received for followed subtype, like stage changes, in addition to Incoming Emails and Discussions."), } _defaults = { From d130a05e8cf147ea983c42de588d3ac9c66e319a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:47:53 +0100 Subject: [PATCH 08/20] [FIX] crm, email_template: opt_out parameter used only for mass mailing and marketing campaigns. Updated help accordingly. bzr revid: tde@openerp.com-20130308124753-dzt5e5nf7zpaq2dk --- addons/crm/crm_lead.py | 2 +- addons/email_template/res_partner.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index e8bba67e1ce..9b3697b8dc5 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -259,7 +259,7 @@ class crm_lead(base_stage, format_address, osv.osv): 'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel (mail, direct, phone, ...)"), 'contact_name': fields.char('Contact Name', size=64), 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1), - 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails or unsubscribed to a campaign."), + 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), diff --git a/addons/email_template/res_partner.py b/addons/email_template/res_partner.py index 987fca43219..bf730f37458 100644 --- a/addons/email_template/res_partner.py +++ b/addons/email_template/res_partner.py @@ -28,8 +28,8 @@ class res_partner(osv.osv): _inherit = 'res.partner' _columns = { - 'opt_out': fields.boolean('Opt-Out', help="If checked, this partner will not receive any automated email " \ - "notifications, such as the availability of invoices."), + 'opt_out': fields.boolean('Opt-Out', + help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), } _defaults = { From 6d78c2f2349ea64d5248644c559c34a0bdccd7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:48:35 +0100 Subject: [PATCH 09/20] [FIX] res_partner: mail now adds forgotten notification_email_send field; otherwise partner manager are not able to change the email reception policy for partners that are not users. bzr revid: tde@openerp.com-20130308124835-sooyabgjhawjg7qr --- addons/mail/res_partner_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/res_partner_view.xml b/addons/mail/res_partner_view.xml index a4aa56ae971..7df5d27c9d0 100644 --- a/addons/mail/res_partner_view.xml +++ b/addons/mail/res_partner_view.xml @@ -7,6 +7,9 @@ res.partner + + +
From 7310643b6b15e09db11de2ec38be007e37706936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 12:46:23 +0100 Subject: [PATCH 10/20] [IMP] email: better reply_to that includes document name. bzr revid: tde@openerp.com-20130311114623-ftcj8s8rbahvjupz --- addons/mail/mail_mail.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 1b3ca152a9a..6219ace864f 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -21,6 +21,7 @@ import base64 import logging +import re from urllib import urlencode from urlparse import urljoin @@ -198,13 +199,27 @@ class mail_mail(osv.Model): :param browse_record mail: mail.mail browse_record :param browse_record partner: specific recipient partner """ + # TDE FIXME BEFORE MERGE: not sure the late change is interesting if mail.reply_to: return mail.reply_to - if not mail.model or not mail.res_id: - return False - if not hasattr(self.pool.get(mail.model), 'message_get_reply_to'): - return False - return self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] + document_name = '' + email_reply_to = False + if mail.model and mail.res_id and hasattr(self.pool.get(mail.model), 'message_get_reply_to'): + email_reply_to = self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] + + if not email_reply_to: + if mail.email_from: + match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex + if match: + email_reply_to = match.group(1) + + if email_reply_to: + if mail.model and mail.res_id: + document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] + if document_name: + return 'Followers of %s <%s>' % (document_name[1], email_reply_to) + else: + return email_reply_to def send_get_email_dict(self, cr, uid, mail, partner=None, context=None): """ Return a dictionary for specific email values, depending on a From a2a8c238dcd04e683ef6d3f1051aaa9e432db89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 13:42:54 +0100 Subject: [PATCH 11/20] [CLEAN] email_template: removed a print statement. bzr revid: tde@openerp.com-20130311124254-xzxs1r6cnqw2zxxc --- addons/email_template/wizard/mail_compose_message.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 9dad18e07f3..255f93998a2 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -70,7 +70,6 @@ class mail_compose_message(osv.TransientModel): elif template_id: # FIXME odo: change the mail generation to avoid attachment duplication values = self.generate_email_for_composer(cr, uid, template_id, res_id, context=context) - print values.get('partner_ids') # transform attachments into attachment_ids values['attachment_ids'] = [] ir_attach_obj = self.pool.get('ir.attachment') From 6ae80a98acb524d0965658446a65bf5fd2a020d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 13:49:14 +0100 Subject: [PATCH 12/20] [CLEAN] mail: cleaned code of modified reply_to. bzr revid: tde@openerp.com-20130311124914-xcdbgmw4w7nm02rv --- addons/mail/mail_mail.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 6219ace864f..1ca3255fd84 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -202,24 +202,26 @@ class mail_mail(osv.Model): # TDE FIXME BEFORE MERGE: not sure the late change is interesting if mail.reply_to: return mail.reply_to - document_name = '' email_reply_to = False + + # if model and res_id: try to use ``message_get_reply_to`` that returns the document alias if mail.model and mail.res_id and hasattr(self.pool.get(mail.model), 'message_get_reply_to'): email_reply_to = self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] + # no alias reply_to -> reply_to will be the email_from, only the email part + if not email_reply_to and mail.email_from: + match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex + if match: + email_reply_to = match.group(1) - if not email_reply_to: - if mail.email_from: - match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex - if match: - email_reply_to = match.group(1) - + # format 'Document name ' if email_reply_to: + document_name = '' if mail.model and mail.res_id: document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] if document_name: - return 'Followers of %s <%s>' % (document_name[1], email_reply_to) - else: - return email_reply_to + email_reply_to = 'Followers of %s <%s>' % (document_name[1], email_reply_to) + + return email_reply_to def send_get_email_dict(self, cr, uid, mail, partner=None, context=None): """ Return a dictionary for specific email values, depending on a From d49889c9a8575cdb31193770172e9de3bb1b3d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:17:46 +0100 Subject: [PATCH 13/20] [IMP] mail: res_partner: improved help for notification_email_send. bzr revid: tde@openerp.com-20130313111746-xfrd8kdhntb39gwl --- addons/mail/res_partner.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 6807c13a08a..05f9fc2ace0 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -30,16 +30,16 @@ class res_partner_mail(osv.Model): _columns = { 'notification_email_send': fields.selection([ - ('all', 'All Messages (discussions, emails, followed system notifications)'), - ('comment', 'Incoming Emails and Discussions'), + ('none', 'Never'), ('email', 'Incoming Emails only'), - ('none', 'Never') + ('comment', 'Incoming Emails and Discussions'), + ('all', 'All Messages (discussions, emails, followed system notifications)'), ], 'Receive Messages by Email', required=True, - help="Policy to receive emails for new notifications pushed to your Inbox. "\ - "'Never' prevents OpenERP from sending emails for notifications. "\ - "'Incoming Emails only' send an email when you receive an incoming email, such as customer replies. "\ - "'Incoming Emails and Discussions' sends emails for incoming emails along with user input. "\ - "'All Messages' also sends emails for notifications received for followed subtype, like stage changes, in addition to Incoming Emails and Discussions."), + help="Policy to receive emails for new messages pushed to your personal Inbox:\n " + "- Never: no emails are sent" + "- Incoming Emails only: for messages received by the system via email" + "- Incoming Emails and Discussions: for incoming emails along with internal discussions" + "- All Messages: for every notification you receive in your Inbox"), } _defaults = { From 6b2c64ff4099a3ab7cb5f0643f20bda5943f3f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:19:26 +0100 Subject: [PATCH 14/20] [IMP] mail_mail: cleaned code about reply_to format: now uses tools.email_split, cleaned a bit the code. bzr revid: tde@openerp.com-20130313111926-45d9gct5nihr6f6n --- addons/mail/mail_mail.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 1ca3255fd84..7720df84f92 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -209,17 +209,15 @@ class mail_mail(osv.Model): email_reply_to = self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] # no alias reply_to -> reply_to will be the email_from, only the email part if not email_reply_to and mail.email_from: - match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex - if match: - email_reply_to = match.group(1) + emails = tools.email_split(mail.email_from) + if emails: + email_reply_to = emails[0] # format 'Document name ' - if email_reply_to: - document_name = '' - if mail.model and mail.res_id: - document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] + if email_reply_to and mail.model and mail.res_id: + document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] if document_name: - email_reply_to = 'Followers of %s <%s>' % (document_name[1], email_reply_to) + email_reply_to = _('Followers of %s <%s>') % (document_name[1], email_reply_to) return email_reply_to From 2f4a59fd0652e1c5b76e5bd62826de084295c91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:20:13 +0100 Subject: [PATCH 15/20] [IMP] email_template, crm: added forgotten filters for opt-out; cleaned help of opt-out; email body is back into internal note as it has been decided that it was too much change for 7.0, especially that email content parsing is not robust enough. bzr revid: tde@openerp.com-20130313112013-veqzplextey1300p --- addons/crm/crm_lead.py | 6 +++++- addons/crm/crm_lead_view.xml | 2 ++ addons/email_template/res_partner.py | 5 +++-- addons/email_template/res_partner_view.xml | 12 ++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9b3697b8dc5..7ab9f110a7b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -259,7 +259,9 @@ class crm_lead(base_stage, format_address, osv.osv): 'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel (mail, direct, phone, ...)"), 'contact_name': fields.char('Contact Name', size=64), 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1), - 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), + 'opt_out': fields.boolean('Opt-Out', oldname='optout', + help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " + "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."), 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), @@ -977,8 +979,10 @@ class crm_lead(base_stage, format_address, osv.osv): """ if custom_values is None: custom_values = {} + desc = html2plaintext(msg.get('body')) if msg.get('body') else '' defaults = { 'name': msg.get('subject') or _("No Subject"), + 'description': desc, 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'partner_id': msg.get('author_id', False), diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index df68f90aa57..39c9a5b98f5 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -341,6 +341,8 @@ + diff --git a/addons/email_template/res_partner.py b/addons/email_template/res_partner.py index bf730f37458..cb3ef67862f 100644 --- a/addons/email_template/res_partner.py +++ b/addons/email_template/res_partner.py @@ -19,7 +19,7 @@ # ############################################################################## -from openerp.osv import fields,osv +from openerp.osv import fields, osv class res_partner(osv.osv): """Inherit res.partner to add a generic opt-out field that can be used @@ -29,7 +29,8 @@ class res_partner(osv.osv): _columns = { 'opt_out': fields.boolean('Opt-Out', - help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), + help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " + "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."), } _defaults = { diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index 3d17120d69e..7e494bd5054 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -11,5 +11,17 @@ + + + res.partner.opt_out.search + res.partner + + + + + + + From fdf7410acffa269ee81ac7a0f03c3f9429b19e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:59:01 +0100 Subject: [PATCH 16/20] [FIX] crm, res_partner: added separator in search views after adding not opt-out filter. bzr revid: tde@openerp.com-20130313115901-s60j69qn3e3q4bpk --- addons/crm/crm_lead_view.xml | 3 ++- addons/email_template/res_partner_view.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 39c9a5b98f5..4c055ce1436 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -341,9 +341,10 @@ + - + diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index 7e494bd5054..c6331ebf514 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -18,8 +18,9 @@ + + help="Leads that did not ask not to be included in mass mailing campaigns" /> From 3dc1a58ed5906212a52c376b62cff69d9ac4ec78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 13:12:21 +0100 Subject: [PATCH 17/20] [FIX] crm, email_template: fixed help messages talking about partners and leads instead of leads and partners... well, I think this comment is not very understandable, but at least there is a commit message. Horray. bzr revid: tde@openerp.com-20130313121221-lo0kmkt2lltyr94e --- addons/crm/crm_lead.py | 2 +- addons/email_template/res_partner_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 7ab9f110a7b..d0be688c8a5 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -261,7 +261,7 @@ class crm_lead(base_stage, format_address, osv.osv): 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1), 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " - "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."), + "Filter 'Available for Mass Mailing' allows users to filter the leads when performing mass mailing."), 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index c6331ebf514..1da3681d3af 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -20,7 +20,7 @@ + help="Partners that did not ask not to be included in mass mailing campaigns" /> From ecd460e0d5a534af2a2536786b401c84267db40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 13:16:59 +0100 Subject: [PATCH 18/20] [IMP] email_template: improved help for email_from. bzr revid: tde@openerp.com-20130313121659-pvdy814zoq9zonf2 --- addons/email_template/email_template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 280e44fa2fb..08ef3ec6e98 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -142,7 +142,9 @@ class email_template(osv.osv): help="If checked, the user's signature will be appended to the text version " "of the message"), 'subject': fields.char('Subject', translate=True, help="Subject (placeholders may be used here)",), - 'email_from': fields.char('From', help="Sender address (placeholders may be used here)"), + 'email_from': fields.char('From', + help="Sender address (placeholders may be used here). If not set, the default " + "value will be the author's email alias if configured, or email address."), 'email_to': fields.char('To (Emails)', help="Comma-separated recipient addresses (placeholders may be used here)"), 'email_recipients': fields.char('To (Partners)', help="Comma-separated ids of recipient partners (placeholders may be used here)"), 'email_cc': fields.char('Cc', help="Carbon copy recipients (placeholders may be used here)"), From 3b989b2c57f8aeb2d8bb92ec6338b862458d9641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 13:26:32 +0100 Subject: [PATCH 19/20] [FIX] mail_message: fixed strings and names for read/unread filters. bzr revid: tde@openerp.com-20130313122632-bwsz0pss88z0ups2 --- addons/mail/mail_message_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml index 7d2e9483773..8f2fb3f1020 100644 --- a/addons/mail/mail_message_view.xml +++ b/addons/mail/mail_message_view.xml @@ -59,12 +59,12 @@ - - + Date: Wed, 13 Mar 2013 13:51:24 +0100 Subject: [PATCH 20/20] [CLEAN] crm, res_partner: added name on added filters; added oline breaks in big help of notification_email_send. bzr revid: tde@openerp.com-20130313125124-wbu17isbi6cay100 --- addons/crm/crm_lead_view.xml | 3 ++- addons/email_template/res_partner_view.xml | 3 ++- addons/mail/res_partner.py | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 4c055ce1436..91154b1ee5a 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -342,7 +342,8 @@ domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}" help="Leads that are assigned to any sales teams I am member of"/> - diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index 1da3681d3af..1eab8029cb2 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -19,7 +19,8 @@ - diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 05f9fc2ace0..8527e60aba0 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -35,10 +35,10 @@ class res_partner_mail(osv.Model): ('comment', 'Incoming Emails and Discussions'), ('all', 'All Messages (discussions, emails, followed system notifications)'), ], 'Receive Messages by Email', required=True, - help="Policy to receive emails for new messages pushed to your personal Inbox:\n " - "- Never: no emails are sent" - "- Incoming Emails only: for messages received by the system via email" - "- Incoming Emails and Discussions: for incoming emails along with internal discussions" + help="Policy to receive emails for new messages pushed to your personal Inbox:\n" + "- Never: no emails are sent\n" + "- Incoming Emails only: for messages received by the system via email\n" + "- Incoming Emails and Discussions: for incoming emails along with internal discussions\n" "- All Messages: for every notification you receive in your Inbox"), }