[IMP]: crm, crm_claim, crm_fundraising, crm_helpdesk: Improvement for log messages
bzr revid: rpa@tinyerp.com-20100722110056-udb2qy6gtwbr5whe
This commit is contained in:
parent
a424fafcc0
commit
6e93201b13
|
@ -301,6 +301,13 @@ class crm_case(object):
|
|||
self.write(cr, uid, ids, {'state': 'cancel',
|
||||
'active': True})
|
||||
self._action(cr, uid, cases, 'cancel')
|
||||
for case in cases:
|
||||
message = "The " + self._description + " '" + case.name + "' has been Cancelled."
|
||||
#TODO: Need to differentiate lead and opportunity
|
||||
# if hasattr(case, 'type'):
|
||||
# #TO CHECK: hasattr gives warning for other crm objects that don't have field 'type'
|
||||
# message = "The " + (case.type or 'Case').title() + " '" + case.name + "' has been Cancelled."
|
||||
self.log(cr, uid, case.id, message)
|
||||
return True
|
||||
|
||||
def case_pending(self, cr, uid, ids, *args):
|
||||
|
|
|
@ -198,8 +198,8 @@ class crm_lead(osv.osv, crm_case):
|
|||
self.write(cr, uid, ids, value)
|
||||
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
type = self.browse(cr, uid, id).type
|
||||
message = (_('The ') + type.title() or 'Lead') + " '" + name + "' "+ _("has been written as Open.")
|
||||
type = self.browse(cr, uid, id).type or 'Lead'
|
||||
message = (_('The ') + type.title()) + " '" + name + "' "+ _("has been Opened.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
|
@ -216,7 +216,7 @@ class crm_lead(osv.osv, crm_case):
|
|||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
lead = self.browse(cr, uid, id)
|
||||
if lead.type == 'lead':
|
||||
message = _('The Lead') + " '" + name + "' "+ _("has been written as Closed.")
|
||||
message = _('The Lead') + " '" + name + "' "+ _("has been Closed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
|
|
|
@ -122,7 +122,21 @@ class crm_meeting(osv.osv, crm_case):
|
|||
}
|
||||
|
||||
return value
|
||||
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""Confirms meeting
|
||||
@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 Meeting Ids
|
||||
@param *args: Tuple Value for additional Params
|
||||
"""
|
||||
res = super(crm_meeting, self).case_open(cr, uid, ids, args)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('The Meeting') + " '" + name + "' "+ _("has been Confirmed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
crm_meeting()
|
||||
|
||||
class calendar_attendee(osv.osv):
|
||||
|
|
|
@ -36,8 +36,6 @@ AVAILABLE_STATES = [
|
|||
|
||||
class crm_opportunity(osv.osv):
|
||||
""" Opportunity Cases """
|
||||
_name = "crm.lead"
|
||||
_description = "Opportunity"
|
||||
_order = "priority,date_action,id desc"
|
||||
_inherit = 'crm.lead'
|
||||
_columns = {
|
||||
|
@ -72,8 +70,10 @@ class crm_opportunity(osv.osv):
|
|||
|
||||
self.write(cr, uid, ids, value)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('The Opportunity') + " '" + name + "' "+ _("has been written as Won.")
|
||||
self.log(cr, uid, id, message)
|
||||
opp = self.browse(cr, uid, id)
|
||||
if opp.type == 'opportunity':
|
||||
message = _('The Opportunity') + " '" + name + "' "+ _("has been Won.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def case_mark_lost(self, cr, uid, ids, *args):
|
||||
|
@ -95,7 +95,7 @@ class crm_opportunity(osv.osv):
|
|||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
opp = self.browse(cr, uid, id)
|
||||
if opp.type == 'opportunity':
|
||||
message = _('The Opportunity') + " '" + name + "' "+ _("has been written as Lost.")
|
||||
message = _('The Opportunity') + " '" + name + "' "+ _("has been Lost.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class crm_claim(osv.osv, crm.crm_case):
|
|||
Crm claim
|
||||
"""
|
||||
_name = "crm.claim"
|
||||
_description = "Claim Cases"
|
||||
_description = "Claim"
|
||||
_order = "id desc"
|
||||
_inherit = ['mailgate.thread']
|
||||
_columns = {
|
||||
|
|
|
@ -26,7 +26,7 @@ class crm_fundraising(osv.osv, crm.crm_case):
|
|||
""" Fund Raising Cases """
|
||||
|
||||
_name = "crm.fundraising"
|
||||
_description = "Fund Raising Cases"
|
||||
_description = "Fund Raising"
|
||||
_order = "id desc"
|
||||
_inherit = ['mailgate.thread']
|
||||
_columns = {
|
||||
|
|
|
@ -27,7 +27,7 @@ class crm_helpdesk(osv.osv, crm.crm_case):
|
|||
""" Helpdesk Cases """
|
||||
|
||||
_name = "crm.helpdesk"
|
||||
_description = "Helpdesk Cases"
|
||||
_description = "Helpdesk"
|
||||
_order = "id desc"
|
||||
_inherit = ['mailgate.thread']
|
||||
_columns = {
|
||||
|
|
Loading…
Reference in New Issue