diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index f2438ab7c64..05fa6ee6886 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -278,7 +278,7 @@ class account_followup_print_all(osv.osv_memory): msg = '' if dest: try: - email_message_obj.email_send(cr, uid, src, dest, sub, body, model='account.followup.print.all') + email_message_obj.schedule_with_attach(cr, uid, src, dest, sub, body, model='account.followup.print.all') msg_sent += partner.name + '\n' except Exception, e: raise osv.except_osv('Error !', e ) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index a2432050f1b..02e929f6a28 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -315,7 +315,7 @@ the rule to mark CC(mail to any other person defined in actions)."), if not emailfrom: raise osv.except_osv(_('Error!'), _("No E-Mail ID Found for your Company address!")) - return email_message_obj.email_send(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, openobject_id=str(obj.id)) + return email_message_obj.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, openobject_id=str(obj.id)) def do_check(self, cr, uid, action, obj, context=None): diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 7cfed6711b4..d49594f4a60 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -507,7 +507,7 @@ property or property parameter."), body = html_invitation % body_vals if mail_to and email_from: attach = self.get_ics_file(cr, uid, res_obj, context=context) - email_message_obj.email_send(cr, uid, + email_message_obj.schedule_with_attach(cr, uid, email_from, mail_to, sub, @@ -893,7 +893,7 @@ From: for att in alarm.attendee_ids: mail_to.append(att.user_id.address_id.email) if mail_to: - email_message_obj.email_send(cr, uid, + email_message_obj.schedule_with_attach(cr, uid, tools.config.get('email_from', False), mail_to, sub, diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 04bf76033fc..687cd836d1a 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -308,7 +308,7 @@ class crm_case(object): return {'value': {'phone': address.phone}} def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context=None): - mailgate_pool = self.pool.get('mailgate.thread') + mailgate_pool = self.pool.get('email.thread') return mailgate_pool.history(cr, uid, cases, keyword, history=history,\ subject=subject, email=email, \ details=details, email_from=email_from,\ @@ -458,7 +458,7 @@ class crm_case(object): raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case")) if not case.user_id.user_email: raise osv.except_osv(_('Error!'), ("User Email is not specified in Case")) - + if destination and case.section_id.user_id: case_email = case.section_id.user_id.user_email else: @@ -487,18 +487,18 @@ class crm_case(object): attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send) # Send an email - subject = "Reminder: [%s] %s" % (str(case.id), case.name, ) - email_message_obj.email_send(cr, uid, - src, - [dest], - subject, - body, - model='crm.case', - reply_to=case.section_id.reply_to, - openobject_id=str(case.id), - attach=attach_to_send - ) - self._history(cr, uid, [case], _('Send'), history=True, subject=subject, email=dest, details=body, email_from=src) + subject = "Reminder: [%s] %s" % (str(case.id), case.name, ) + email_message_obj.schedule_with_attach(cr, uid, + src, + [dest], + subject, + body, + model='crm.case', + reply_to=case.section_id.reply_to, + openobject_id=str(case.id), + attach=attach_to_send + ) + self._history(cr, uid, [case], _('Send'), history=True, subject=subject, email=dest, details=body, email_from=src) return True def _check(self, cr, uid, ids=False, context=None): diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index d877c074020..acb7801c7c9 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -66,7 +66,7 @@ this if you want the rule to send an email to the partner."), if not emailfrom: raise osv.except_osv(_('Error!'), _("No E-Mail ID Found for your Company address!")) - return email_message_obj.email_send(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, openobject_id=str(obj.id)) + return email_message_obj.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, openobject_id=str(obj.id)) def do_check(self, cr, uid, action, obj, context=None): """ @param self: The object pointer diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index e229ef83730..31a61f86f47 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -40,7 +40,7 @@ class crm_lead(crm_case, osv.osv): _name = "crm.lead" _description = "Lead/Opportunity" _order = "date_action, priority, id desc" - _inherit = ['mailgate.thread','res.partner.address'] + _inherit = ['email.thread','res.partner.address'] def _compute_day(self, cr, uid, ids, fields, args, context=None): """ @param cr: the current row, from the database cursor, @@ -326,7 +326,7 @@ class crm_lead(crm_case, osv.osv): @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks """ - mailgate_pool = self.pool.get('email.server.tools') + thread_pool = self.pool.get('email.thread') subject = msg.get('subject') body = msg.get('body') @@ -343,7 +343,7 @@ class crm_lead(crm_case, osv.osv): if msg.get('priority', False): vals['priority'] = priority - res = mailgate_pool.get_partner(cr, uid, msg.get('from') or msg.get_unixfrom()) + res = thread_pool.get_partner(cr, uid, msg.get('from') or msg.get_unixfrom()) if res: vals.update(res) @@ -399,18 +399,6 @@ class crm_lead(crm_case, osv.osv): res = self.write(cr, uid, [case.id], values, context=context) return res - def msg_send(self, cr, uid, id, *args, **argv): - - """ Send The Message - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of email’s IDs - @param *args: Return Tuple Value - @param **args: Return Dictionary of Keyword Value - """ - return True - def on_change_optin(self, cr, uid, ids, optin): return {'value':{'optin':optin,'optout':False}} diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 0313595193a..1ff6a4d75a0 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -199,13 +199,13 @@ - + - +