[FIX] rename method name for meeting creation notification and escalate notification...
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>
Mon, 12 Mar 2012 13:15:25 +0000 (18:45 +0530)
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>
Mon, 12 Mar 2012 13:15:25 +0000 (18:45 +0530)
bzr revid: bth@tinyerp.com-20120312131525-0rr3sr1peh30r8ee

addons/crm/crm.py
addons/crm/crm_meeting.py

index 61694b0..d7edfaa 100644 (file)
@@ -273,9 +273,6 @@ class crm_base(object):
     def _case_reset_notification(self, cr, uid, ids, context=None):
         return True
 
-    def _case_escalate_notification(self, cr, uid, ids, context=None):
-        return True
-
     def _case_phonecall_notification(self, case, action, context=None):
         return True
 
@@ -415,6 +412,9 @@ class crm_case(crm_base):
                 default.update({ 'date_open': False })
         return super(crm_case, self).copy(cr, uid, id, default, context=context)
 
+    def _case_escalate_notification(self, cr, uid, ids, context=None):
+        return True
+
     def case_open(self, cr, uid, ids, context=None):
         """Opens Case"""
         cases = self.browse(cr, uid, ids)
index 9bc5f44..033eb0d 100644 (file)
@@ -82,7 +82,7 @@ class crm_meeting(crm_base, osv.osv):
 
     def create(self, cr, uid, vals, context=None):
         obj_id = super(crm_meeting, self).create(cr, uid, vals, context=context)
-        self._case_opportunity_meeting_notification(cr, uid, [obj_id], context=context)
+        self._case_create_notification(cr, uid, [obj_id], context=context)
         return obj_id
 
     def get_needaction_user_id(self, cr, uid, ids, name, arg, context=None):
@@ -93,11 +93,11 @@ class crm_meeting(crm_base, osv.osv):
                 result[obj.id] = obj.user_id.id
         return result
 
-    def _case_opportunity_meeting_notification(self, cr, uid, ids, context=None):
+    def _case_create_notification(self, cr, uid, ids, context=None):
         lead_obj = self.pool.get('crm.lead')
         phonecall_obj = self.pool.get('crm.phonecall')
         for obj in self.browse(cr, uid, ids, context=context):
-            if(obj.opportunity_id.id):
+            if(obj.opportunity_id.id): # meeting can be create from phonecalls or opportunities, therefore checking for the parent
                 newid = obj.opportunity_id.id
                 message = _("Meeting has been <b>scheduled</b> on <em>%s</em> for opportunity.") % (obj.date)
                 for lead in lead_obj.browse(cr, uid, [newid], context=context):