[IMP] notification with need action in phonecall when schedule a call.

bzr revid: bth@tinyerp.com-20120229070240-dqhfox2oyp7but6t
This commit is contained in:
Bhumi Thakkar (Open ERP) 2012-02-29 12:32:40 +05:30
parent 1c2730f8fc
commit 23efc0893b
2 changed files with 14 additions and 12 deletions

View File

@ -341,6 +341,8 @@ class crm_lead(crm_case, osv.osv):
else :
message = _("<b>%s a call</b>.") % (action)
case.message_append_note('', message)
if action == "schedule" :
phonecall.message_append_note(cr, uid, ids, '', message, need_action_user_id=obj.user_id.id)
def case_open(self, cr, uid, ids, context=None):
res = super(crm_lead, self).case_open(cr, uid, ids, context)

View File

@ -50,12 +50,12 @@ class crm_phonecall(crm_base, osv.osv):
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
'state': fields.selection([
('draft', 'Draft'),
('open', 'Todo'),
('cancel', 'Cancelled'),
('done', 'Held'),
('draft', 'Draft'),
('open', 'Todo'),
('cancel', 'Cancelled'),
('done', 'Held'),
('pending', 'Not Held'),
], 'State', size=16, readonly=True,
], 'State', size=16, readonly=True,
help='The state is set to \'Todo\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the call is over, the state is set to \'Held\'.\
@ -89,8 +89,8 @@ class crm_phonecall(crm_base, osv.osv):
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'priority': crm.AVAILABLE_PRIORITIES[2][0],
'state': _get_default_state,
'priority': crm.AVAILABLE_PRIORITIES[2][0],
'state': _get_default_state,
'user_id': lambda self,cr,uid,ctx: uid,
'active': 1,
}
@ -122,7 +122,7 @@ class crm_phonecall(crm_base, osv.osv):
def case_reset(self, cr, uid, ids, *args):
"""Resets case as Todo
"""
res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall')
res = super(crm_phonecall, self).case_reset(cr, uid, ids, args)
self.write(cr, uid, ids, {'duration': 0.0, 'state':'open'})
return res
@ -163,7 +163,7 @@ class crm_phonecall(crm_base, osv.osv):
'partner_mobile' : call.partner_mobile,
'priority': call.priority,
}
new_id = self.create(cr, uid, vals, context=context)
self.case_open(cr, uid, [new_id])
if action == 'log':
@ -248,13 +248,13 @@ class crm_phonecall(crm_base, osv.osv):
'planned_revenue': planned_revenue,
'probability': probability,
'partner_id': partner_id or False,
'partner_address_id': default_contact and default_contact.id,
'partner_address_id': default_contact and default_contact.id,
'phone': default_contact and default_contact.phone,
'mobile': default_contact and default_contact.mobile,
'section_id': call.section_id and call.section_id.id or False,
'description': call.description or False,
'priority': call.priority,
'type': 'opportunity',
'type': 'opportunity',
'phone': call.partner_phone or False,
'email_from': default_contact and default_contact.email,
})
@ -266,7 +266,7 @@ class crm_phonecall(crm_base, osv.osv):
self.case_close(cr, uid, [call.id])
opportunity.case_open(cr, uid, [opportunity_id])
opportunity_dict[call.id] = opportunity_id
return opportunity_dict
return opportunity_dict
def action_make_meeting(self, cr, uid, ids, context=None):
"""