[IMP] add notification for meeting and phonecall action.replaced notifications methods from crm_case class to crm_base class.

bzr revid: bth@tinyerp.com-20120227105012-01d441d3pqrkvhk7
This commit is contained in:
Bhumi Thakkar (Open ERP)
2012-02-27 16:20:12 +05:30
parent c232373c4b
commit 18e423d9a2
2 changed files with 26 additions and 15 deletions
+16 -15
View File
@@ -258,7 +258,23 @@ class crm_base(object):
data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
return {'value': data}
def _case_open_notification(self, case, context=None):
return True
def _case_close_notification(self, case, context=None):
return True
def _case_cancel_notification(self, case, context=None):
return True
def _case_pending_notification(self, case, context=None):
return True
def _case_escalate_notification(self, case, context=None):
return True
def _case_phonecall_notification(self, case, action, context=None):
return True
def case_open(self, cr, uid, ids, context=None):
"""Opens Case
@@ -392,21 +408,6 @@ class crm_case(crm_base):
default.update({ 'date_open': False })
return super(crm_case, self).copy(cr, uid, id, default, context=context)
def _case_open_notification(self, case, context=None):
return True
def _case_close_notification(self, case, context=None):
return True
def _case_cancel_notification(self, case, context=None):
return True
def _case_pending_notification(self, case, context=None):
return True
def _case_escalate_notification(self, case, context=None):
return True
def case_open(self, cr, uid, ids, context=None):
"""Opens Case"""
cases = self.browse(cr, uid, ids)
+10
View File
@@ -307,6 +307,14 @@ class crm_lead(crm_case, osv.osv):
message = _("The lead <em>%s</em> is <b>escalated</b>.") % (case.name,)
case.message_append_note('' ,message)
def _case_phonecall_notification(self, case, action, context=None):
message = _("<b>%s a call</b> for the opportunity <em>%s</em>.") % (action,case.name)
case.message_append_note('', message, need_action_user_id=case.user_id.id)
def _case_opportunity_meeting_notification(self, case, context=None):
message = _("The opportunity <em>%s</em> is scheduled for <b>meeting</b>.") % (case.name)
case.message_append_note('', message, need_action_user_id=case.user_id.id)
def case_open(self, cr, uid, ids, context=None):
res = super(crm_lead, self).case_open(cr, uid, ids, context)
for lead in self.browse(cr, uid, ids, context=context):
@@ -727,6 +735,7 @@ class crm_lead(crm_case, osv.osv):
if action == 'log':
phonecall.case_close(cr, uid, [new_id])
phonecall_dict[lead.id] = new_id
self._case_phonecall_notification(lead,action,context=context)
return phonecall_dict
@@ -844,6 +853,7 @@ class crm_lead(crm_case, osv.osv):
'search_view_id': search_view and search_view[1] or False,
'nodestroy': True
}
self._case_opportunity_meeting_notification(opp,context=context)
return value