[REM]: Remove Un-used mehtods when state is remove
bzr revid: aja@tinyerp.com-20130614132023-5t2rp27pv9pmd7in
This commit is contained in:
parent
a5cc3f4da6
commit
929eea1aa3
|
@ -199,43 +199,3 @@ class base_stage(object):
|
||||||
raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
|
raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
|
||||||
self.write(cr, uid, [case.id], data, context=context)
|
self.write(cr, uid, [case.id], data, context=context)
|
||||||
return True
|
return True
|
||||||
# TODO: Need To Clean
|
|
||||||
# def case_open(self, cr, uid, ids, context=None):
|
|
||||||
# """ Opens case """
|
|
||||||
# cases = self.browse(cr, uid, ids, context=context)
|
|
||||||
# for case in cases:
|
|
||||||
# data = {'active': True}
|
|
||||||
# if not case.user_id:
|
|
||||||
# data['user_id'] = uid
|
|
||||||
# self.case_set(cr, uid, [case.id], data, context=context)
|
|
||||||
# return True
|
|
||||||
|
|
||||||
# def case_close(self, cr, uid, ids, context=None):
|
|
||||||
# """ Closes case """
|
|
||||||
# return self.case_set(cr, uid, ids, None, {'active': True, 'date_closed': fields.datetime.now()}, context=context)
|
|
||||||
|
|
||||||
# def case_cancel(self, cr, uid, ids, context=None):
|
|
||||||
# """ Cancels case """
|
|
||||||
# return self.case_set(cr, uid, ids, None, {'active': True}, context=context)
|
|
||||||
|
|
||||||
# def case_pending(self, cr, uid, ids, context=None):
|
|
||||||
# """ Set case as pending """
|
|
||||||
# return self.case_set(cr, uid, ids, None, {'active': True}, context=context)
|
|
||||||
|
|
||||||
# def case_reset(self, cr, uid, ids, context=None):
|
|
||||||
# """ Resets case as draft """
|
|
||||||
# return self.case_set(cr, uid, ids, None, {'active': True}, context=context)
|
|
||||||
|
|
||||||
def case_set(self, cr, uid, ids, new_stage_id, values_to_update=None, context=None):
|
|
||||||
""" Generic method for setting case. This methods wraps the update
|
|
||||||
of the record.
|
|
||||||
|
|
||||||
:params new_stage_id: alternatively, you may directly give the
|
|
||||||
new stage of the record
|
|
||||||
:params update_values: values that will be added with the state
|
|
||||||
update when writing values to the record.
|
|
||||||
"""
|
|
||||||
self.stage_set(cr, uid, ids, new_stage_id, context=context)
|
|
||||||
if values_to_update:
|
|
||||||
self.write(cr, uid, ids, values_to_update, context=context)
|
|
||||||
return True
|
|
||||||
|
|
|
@ -107,10 +107,10 @@ Dashboard for CRM will include:
|
||||||
],
|
],
|
||||||
'test': [
|
'test': [
|
||||||
'test/crm_lead_message.yml',
|
'test/crm_lead_message.yml',
|
||||||
# 'test/lead2opportunity2win.yml',
|
# 'test/lead2opportunity2win.yml', # TODO: Need To Clean
|
||||||
'test/lead2opportunity_assign_salesmen.yml',
|
'test/lead2opportunity_assign_salesmen.yml',
|
||||||
'test/crm_lead_merge.yml',
|
'test/crm_lead_merge.yml',
|
||||||
# 'test/crm_lead_cancel.yml',
|
# 'test/crm_lead_cancel.yml',# TODO: Need To Clean
|
||||||
'test/segmentation.yml',
|
'test/segmentation.yml',
|
||||||
'test/phonecalls.yml',
|
'test/phonecalls.yml',
|
||||||
'test/crm_lead_onchange.yml',
|
'test/crm_lead_onchange.yml',
|
||||||
|
|
|
@ -143,14 +143,6 @@ class crm_claim(base_stage, osv.osv):
|
||||||
if stage_ids:
|
if stage_ids:
|
||||||
return stage_ids[0]
|
return stage_ids[0]
|
||||||
return False
|
return False
|
||||||
#TODO : Need To Clean
|
|
||||||
# def case_refuse(self, cr, uid, ids, context=None):
|
|
||||||
# """ Mark the case as refused: state=done and case_refused=True """
|
|
||||||
# for lead in self.browse(cr, uid, ids):
|
|
||||||
# stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, ['&', ('state', '=', 'done'), ('case_refused', '=', True)], context=context)
|
|
||||||
# if stage_id:
|
|
||||||
# self.case_set(cr, uid, [lead.id], values_to_update={}, new_stage_id=stage_id, context=context)
|
|
||||||
# return True
|
|
||||||
|
|
||||||
def onchange_partner_id(self, cr, uid, ids, part, email=False):
|
def onchange_partner_id(self, cr, uid, ids, part, email=False):
|
||||||
"""This function returns value of partner address based on partner
|
"""This function returns value of partner address based on partner
|
||||||
|
|
|
@ -386,20 +386,6 @@ class hr_applicant(base_stage, osv.Model):
|
||||||
if applicant.job_id:
|
if applicant.job_id:
|
||||||
self.pool.get('hr.job').message_post(cr, uid, [applicant.job_id.id], body=_('Applicant <b>created</b>'), subtype="hr_recruitment.mt_job_new_applicant", context=context)
|
self.pool.get('hr.job').message_post(cr, uid, [applicant.job_id.id], body=_('Applicant <b>created</b>'), subtype="hr_recruitment.mt_job_new_applicant", context=context)
|
||||||
return obj_id
|
return obj_id
|
||||||
# TODO : Need To Clean
|
|
||||||
# def case_open(self, cr, uid, ids, context=None):
|
|
||||||
# """
|
|
||||||
# open Request of the applicant for the hr_recruitment
|
|
||||||
# """
|
|
||||||
# res = super(hr_applicant, self).case_open(cr, uid, ids, context)
|
|
||||||
# date = self.read(cr, uid, ids, ['date_open'])[0]
|
|
||||||
# if not date['date_open']:
|
|
||||||
# self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S'),})
|
|
||||||
# return res
|
|
||||||
|
|
||||||
# def case_close(self, cr, uid, ids, context=None):
|
|
||||||
# res = super(hr_applicant, self).case_close(cr, uid, ids, context)
|
|
||||||
# return res
|
|
||||||
|
|
||||||
def case_close_with_emp(self, cr, uid, ids, context=None):
|
def case_close_with_emp(self, cr, uid, ids, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
|
@ -432,27 +418,6 @@ class hr_applicant(base_stage, osv.Model):
|
||||||
dict_act_window['view_mode'] = 'form,tree'
|
dict_act_window['view_mode'] = 'form,tree'
|
||||||
return dict_act_window
|
return dict_act_window
|
||||||
|
|
||||||
# TODO: Need To Clean
|
|
||||||
# def case_cancel(self, cr, uid, ids, context=None):
|
|
||||||
# """Overrides cancel for crm_case for setting probability
|
|
||||||
# """
|
|
||||||
# res = super(hr_applicant, self).case_cancel(cr, uid, ids, context)
|
|
||||||
# self.write(cr, uid, ids, {'probability': 0.0})
|
|
||||||
# return res
|
|
||||||
|
|
||||||
# def case_pending(self, cr, uid, ids, context=None):
|
|
||||||
# """Marks case as pending"""
|
|
||||||
# res = super(hr_applicant, self).case_pending(cr, uid, ids, context)
|
|
||||||
# self.write(cr, uid, ids, {'probability': 0.0})
|
|
||||||
# return res
|
|
||||||
|
|
||||||
# def case_reset(self, cr, uid, ids, context=None):
|
|
||||||
# """Resets case as draft
|
|
||||||
# """
|
|
||||||
# res = super(hr_applicant, self).case_reset(cr, uid, ids, context)
|
|
||||||
# self.write(cr, uid, ids, {'date_open': False, 'date_closed': False})
|
|
||||||
# return res
|
|
||||||
|
|
||||||
def set_priority(self, cr, uid, ids, priority, *args):
|
def set_priority(self, cr, uid, ids, priority, *args):
|
||||||
"""Set applicant priority
|
"""Set applicant priority
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -933,79 +933,6 @@ class task(base_stage, osv.osv):
|
||||||
raise osv.except_osv(_("Warning!"), _("Child task still open.\nPlease cancel or complete child task first."))
|
raise osv.except_osv(_("Warning!"), _("Child task still open.\nPlease cancel or complete child task first."))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# TODO: Need To Clean
|
|
||||||
# def action_close(self, cr, uid, ids, context=None):
|
|
||||||
# """ This action closes the task
|
|
||||||
# """
|
|
||||||
# task_id = len(ids) and ids[0] or False
|
|
||||||
# self._check_child_task(cr, uid, ids, context=context)
|
|
||||||
# if not task_id: return False
|
|
||||||
# return self.do_close(cr, uid, [task_id], context=context)
|
|
||||||
|
|
||||||
# def do_close(self, cr, uid, ids, context=None):
|
|
||||||
# """ Compatibility when changing to case_close. """
|
|
||||||
# return self.case_close(cr, uid, ids, context=context)
|
|
||||||
|
|
||||||
# def case_close(self, cr, uid, ids, context=None):
|
|
||||||
# """ Closes Task """
|
|
||||||
# if not isinstance(ids, list): ids = [ids]
|
|
||||||
# for task in self.browse(cr, uid, ids, context=context):
|
|
||||||
# vals = {}
|
|
||||||
# project = task.project_id
|
|
||||||
# for parent_id in task.parent_ids:
|
|
||||||
# if parent_id.state in ('pending','draft'):
|
|
||||||
# reopen = True
|
|
||||||
# for child in parent_id.child_ids:
|
|
||||||
# if child.id != task.id and child.state not in ('done','cancelled'):
|
|
||||||
# reopen = False
|
|
||||||
# if reopen:
|
|
||||||
# self.do_reopen(cr, uid, [parent_id.id], context=context)
|
|
||||||
# # close task
|
|
||||||
# vals['remaining_hours'] = 0.0
|
|
||||||
# if not task.date_end:
|
|
||||||
# vals['date_end'] = fields.datetime.now()
|
|
||||||
# self.case_set(cr, uid, [task.id], 'done', vals, context=context)
|
|
||||||
# return True
|
|
||||||
|
|
||||||
# def do_reopen(self, cr, uid, ids, context=None):
|
|
||||||
# for task in self.browse(cr, uid, ids, context=context):
|
|
||||||
# project = task.project_id
|
|
||||||
# self.case_set(cr, uid, [task.id], 'open', {}, context=context)
|
|
||||||
# return True
|
|
||||||
|
|
||||||
# def do_cancel(self, cr, uid, ids, context=None):
|
|
||||||
# """ Compatibility when changing to case_cancel. """
|
|
||||||
# return self.case_cancel(cr, uid, ids, context=context)
|
|
||||||
|
|
||||||
# def case_cancel(self, cr, uid, ids, context=None):
|
|
||||||
# tasks = self.browse(cr, uid, ids, context=context)
|
|
||||||
# self._check_child_task(cr, uid, ids, context=context)
|
|
||||||
# for task in tasks:
|
|
||||||
# self.case_set(cr, uid, [task.id], 'cancelled', {'remaining_hours': 0.0}, context=context)
|
|
||||||
# return True
|
|
||||||
|
|
||||||
# def do_open(self, cr, uid, ids, context=None):
|
|
||||||
# """ Compatibility when changing to case_open. """
|
|
||||||
# return self.case_open(cr, uid, ids, context=context)
|
|
||||||
|
|
||||||
# def case_open(self, cr, uid, ids, context=None):
|
|
||||||
# if not isinstance(ids,list): ids = [ids]
|
|
||||||
# return self.case_set(cr, uid, ids, 'open', {'date_start': fields.datetime.now()}, context=context)
|
|
||||||
|
|
||||||
# def do_draft(self, cr, uid, ids, context=None):
|
|
||||||
# """ Compatibility when changing to case_draft. """
|
|
||||||
# return self.case_draft(cr, uid, ids, context=context)
|
|
||||||
|
|
||||||
# def case_draft(self, cr, uid, ids, context=None):
|
|
||||||
# return self.case_set(cr, uid, ids, 'draft', {}, context=context)
|
|
||||||
|
|
||||||
# def do_pending(self, cr, uid, ids, context=None):
|
|
||||||
# """ Compatibility when changing to case_pending. """
|
|
||||||
# return self.case_pending(cr, uid, ids, context=context)
|
|
||||||
|
|
||||||
# def case_pending(self, cr, uid, ids, context=None):
|
|
||||||
# return self.case_set(cr, uid, ids, 'pending', {}, context=context)
|
|
||||||
|
|
||||||
def _delegate_task_attachments(self, cr, uid, task_id, delegated_task_id, context=None):
|
def _delegate_task_attachments(self, cr, uid, task_id, delegated_task_id, context=None):
|
||||||
attachment = self.pool.get('ir.attachment')
|
attachment = self.pool.get('ir.attachment')
|
||||||
attachment_ids = attachment.search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', task_id)], context=context)
|
attachment_ids = attachment.search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', task_id)], context=context)
|
||||||
|
@ -1210,18 +1137,6 @@ class task(base_stage, osv.osv):
|
||||||
getattr(self,act)(cr, uid, ids, context=context)
|
getattr(self,act)(cr, uid, ids, context=context)
|
||||||
return super(task,self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context)
|
return super(task,self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context)
|
||||||
|
|
||||||
# TODO : Need To Clean
|
|
||||||
# def project_task_reevaluate(self, cr, uid, ids, context=None):
|
|
||||||
# if self.pool.get('res.users').has_group(cr, uid, 'project.group_time_work_estimation_tasks'):
|
|
||||||
# return {
|
|
||||||
# 'view_type': 'form',
|
|
||||||
# "view_mode": 'form',
|
|
||||||
# 'res_model': 'project.task.reevaluate',
|
|
||||||
# 'type': 'ir.actions.act_window',
|
|
||||||
# 'target': 'new',
|
|
||||||
# }
|
|
||||||
# return self.do_reopen(cr, uid, ids, context=context)
|
|
||||||
|
|
||||||
class project_work(osv.osv):
|
class project_work(osv.osv):
|
||||||
_name = "project.task.work"
|
_name = "project.task.work"
|
||||||
_description = "Project Task Work"
|
_description = "Project Task Work"
|
||||||
|
|
|
@ -453,11 +453,6 @@ class project_issue(base_stage, osv.osv):
|
||||||
if stage_ids:
|
if stage_ids:
|
||||||
return stage_ids[0]
|
return stage_ids[0]
|
||||||
return False
|
return False
|
||||||
# TODO : Need To Clean
|
|
||||||
# def case_cancel(self, cr, uid, ids, context=None):
|
|
||||||
# """ Cancels case """
|
|
||||||
# self.case_set(cr, uid, ids, 'cancelled', {'active': True}, context=context)
|
|
||||||
# return True
|
|
||||||
|
|
||||||
def case_escalate(self, cr, uid, ids, context=None):
|
def case_escalate(self, cr, uid, ids, context=None):
|
||||||
cases = self.browse(cr, uid, ids)
|
cases = self.browse(cr, uid, ids)
|
||||||
|
|
Loading…
Reference in New Issue