[FIX] changes in reset functions.
bzr revid: bth@tinyerp.com-20120306105017-w2znwg19b713v1cb
This commit is contained in:
parent
b0d0b176ab
commit
d9dca412cc
|
@ -273,7 +273,7 @@ class crm_base(object):
|
|||
def _case_pending_notification(self, case, context=None):
|
||||
return True
|
||||
|
||||
def _case_reset_notification(self, case, context=None):
|
||||
def _case_reset_notification(self, cr, uid, ids, context=None):
|
||||
return True
|
||||
|
||||
def _case_escalate_notification(self, case, context=None):
|
||||
|
@ -339,7 +339,7 @@ class crm_base(object):
|
|||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self.write(cr, uid, ids, {'state': 'draft', 'active': True})
|
||||
self._case_reset_notification(cases, context=context)
|
||||
self._case_reset_notification(cr, uid, ids, context=context)
|
||||
self._action(cr, uid, cases, 'draft')
|
||||
return True
|
||||
|
||||
|
@ -489,7 +489,7 @@ class crm_case(crm_base):
|
|||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self.write(cr, uid, ids, {'state': state, 'active': True})
|
||||
self._case_reset_notification(cases, context=context);
|
||||
self._case_reset_notification(cr, uid, ids, context=context)
|
||||
self._action(cr, uid, cases, state)
|
||||
return True
|
||||
|
||||
|
|
|
@ -271,6 +271,14 @@ class crm_lead(crm_case, osv.osv):
|
|||
def stage_find_won(self, cr, uid, section_id):
|
||||
return self.stage_find_percent(cr, uid, 100.0, section_id)
|
||||
|
||||
def _case_reset_notification(self, cr, uid, ids, context=None):
|
||||
for lead in self.browse(cr, uid, ids, context=context):
|
||||
if lead.type == 'lead':
|
||||
message = _("The lead is <b>renewed</b>.")
|
||||
elif lead.type == 'opportunity':
|
||||
message = _("The opportunity is <b>renewed</b>.")
|
||||
lead.message_append_note('' ,message, need_action_user_id=lead.user_id.id)
|
||||
|
||||
def _case_create_notification(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_subscribe(cr, uid, ids, [obj.user_id.id], context=context)
|
||||
|
@ -334,13 +342,6 @@ class crm_lead(crm_case, osv.osv):
|
|||
message = _("The lead is <b>escalated</b>.")
|
||||
case.message_append_note('' ,message)
|
||||
|
||||
def _case_reset_notification(self, case, context=None):
|
||||
if case[0].type == 'lead':
|
||||
message = _("The lead is <b>renewed</b>.")
|
||||
elif case[0].type == 'opportunity':
|
||||
message = _("The opportunity is <b>renewed</b>.")
|
||||
case[0].message_append_note('' ,message, need_action_user_id=case[0].user_id.id)
|
||||
|
||||
def _case_phonecall_notification(self, cr, uid, ids, case, phonecall, action, context=None):
|
||||
for obj in phonecall.browse(cr, uid, ids, context=context):
|
||||
if action == "schedule" :
|
||||
|
|
|
@ -110,9 +110,10 @@ class crm_meeting(crm_base, osv.osv):
|
|||
message = _("The meeting is <b>done</b>.")
|
||||
meeting[0].message_append_note('' ,message)
|
||||
|
||||
def _case_reset_notification(self, meeting, context=None):
|
||||
message = _("The meeting is <b>unconfirmed</b>.")
|
||||
meeting[0].message_append_note('' ,message)
|
||||
def _case_reset_notification(self, cr, uid, ids, context=None):
|
||||
for meeting in self.browse(cr, uid, ids, context=context):
|
||||
message = _("The lead is <b>renew</b>.")
|
||||
meeting.message_append_note('' ,message, need_action_user_id=meeting.user_id.id)
|
||||
|
||||
def _case_open_notification(self, meeting, context=None):
|
||||
if meeting.state != 'draft':
|
||||
|
|
Loading…
Reference in New Issue