diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index 5e5f408673a..dfe2e4653c3 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -63,7 +63,7 @@ - + Module CRM has been installed From the top menu Sales, you can: trace leads and opportunities, get accurate forecast on your sales pipeline, plan meetings and phonecalls, get realtime statistics and efficiently organize the communication with your prospects. diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index b02369cce9f..976eb333ddd 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -865,9 +865,7 @@ class crm_lead(base_stage, osv.osv): def stage_set_send_note(self, cr, uid, ids, stage_id, context=None): """ Override of the (void) default notification method. """ stage_name = self.pool.get('crm.case.stage').name_get(cr, uid, [stage_id], context=context)[0][1] - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_stage_change') - res_id = res[1] - return self.message_append_note(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype_id=res_id,context=context) + return self.message_append_note(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype_id="stage change",context=context) def case_get_note_msg_prefix(self, cr, uid, lead, context=None): if isinstance(lead, (int, long)): @@ -877,45 +875,33 @@ class crm_lead(base_stage, osv.osv): def create_send_note(self, cr, uid, ids, context=None): for id in ids: message = _("%s has been created.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context)) - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_new') - res_id = res[1] - self.message_append_note(cr, uid, [id], body=message, subtype_id=res_id, context=context) + self.message_append_note(cr, uid, [id], body=message, subtype_id="new", context=context) return True def case_mark_lost_send_note(self, cr, uid, ids, context=None): message = _("Opportunity has been lost.") - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_lost') - res_id = res[1] - return self.message_append_note(cr, uid, ids, body=message,subtype_id=res_id, context=context) + return self.message_append_note(cr, uid, ids, body=message,subtype_id="lost", context=context) def case_mark_won_send_note(self, cr, uid, ids, context=None): message = _("Opportunity has been won.") - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_won') - res_id = res[1] - return self.message_append_note(cr, uid, ids, body=message, subtype_id=res_id, context=context) + return self.message_append_note(cr, uid, ids, body=message, subtype_id="won", context=context) def schedule_phonecall_send_note(self, cr, uid, ids, phonecall_id, action, context=None): phonecall = self.pool.get('crm.phonecall').browse(cr, uid, [phonecall_id], context=context)[0] if action == 'log': prefix = 'Logged' else: prefix = 'Scheduled' message = _("%s a call for the %s.") % (prefix, phonecall.date) - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_other') - res_id = res[1] - return self.message_append_note(cr, uid, ids, body=message, subtype_id=res_id, context=context) + return self.message_append_note(cr, uid, ids, body=message, context=context) def _lead_set_partner_send_note(self, cr, uid, ids, context=None): for lead in self.browse(cr, uid, ids, context=context): message = _("%s partner is now set to %s." % (self.case_get_note_msg_prefix(cr, uid, lead, context=context), lead.partner_id.name)) - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_other') - res_id = res[1] - lead.message_append_note(body=message, subtype_id=res_id) + lead.message_append_note(body=message) return True def convert_opportunity_send_note(self, cr, uid, lead, context=None): message = _("Lead has been converted to an opportunity.") - res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'mail_subtype_lead_other') - res_id = res[1] - lead.message_append_note(body=message, subtype_id=res_id) + lead.message_append_note(body=message) return True crm_lead() diff --git a/addons/mail/data/mail_group_data.xml b/addons/mail/data/mail_group_data.xml index 09a6ca29a2d..3a2ad01fab8 100644 --- a/addons/mail/data/mail_group_data.xml +++ b/addons/mail/data/mail_group_data.xml @@ -16,7 +16,7 @@ - + Welcome to OpenERP! Your homepage is a summary of messages you received and key information about documents you follow. diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 14e9138be55..8d1259ea4ff 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -228,8 +228,8 @@ class mail_thread(osv.Model): ret_dict[model_name] = model._description return ret_dict - def message_append(self, cr, uid, threads, subject, body_text=None, body_html=None, - type = 'email', subtype_id = False, email_date = None, parent_id = False, + def message_append(self, cr, uid, threads, subject,subtype_id = "other", body_text=None, body_html=None, + type = 'email', email_date = None, parent_id = False, content_subtype='plain', state=None, partner_ids=None, email_from=False, email_to=False, email_cc=None, email_bcc=None, reply_to=None, @@ -335,7 +335,6 @@ class mail_thread(osv.Model): 'parent_id': parent_id, 'date': email_date or fields.datetime.now(), 'type': type, - 'subtype_id' : subtype_id, 'content_subtype': content_subtype, 'state': state, 'message_id': message_id, @@ -383,11 +382,11 @@ class mail_thread(osv.Model): """ return self.message_append(cr, uid, ids, subject = msg_dict.get('subject'), + subtype_id = msg_dict.get('subtype_id','other'), body_text = msg_dict.get('body_text'), body_html= msg_dict.get('body_html'), parent_id = msg_dict.get('parent_id', False), type = msg_dict.get('type', 'email'), - subtype_id = msg_dict.get('subtype_id', False), content_subtype = msg_dict.get('content_subtype'), state = msg_dict.get('state'), partner_ids = msg_dict.get('partner_ids'), @@ -867,7 +866,7 @@ class mail_thread(osv.Model): now deprecated res.log.") self.message_append_note(cr, uid, [id], 'res.log', message, context=context) - def message_append_note(self, cr, uid, ids, subject=None, subtype_id=False, body=None, parent_id=False, + def message_append_note(self, cr, uid, ids, subject=None, subtype_id='other', body=None, parent_id=False, type='notification', content_subtype='html', context=None): if content_subtype == 'html': body_html = body @@ -875,8 +874,8 @@ class mail_thread(osv.Model): else: body_html = body body_text = body - return self.message_append(cr, uid, ids, subject, body_html, body_text, - type, subtype_id = subtype_id, parent_id = parent_id, + return self.message_append(cr, uid, ids, subject,subtype_id, body_html, body_text, + type, parent_id = parent_id, content_subtype=content_subtype, context=context) #------------------------------------------------------