[FIX]: removed method _history() and called history() instead
bzr revid: rha@tinyerp.com-20110421091915-fw1sr549av69mm4b
This commit is contained in:
parent
b794d93e2a
commit
4b2f93cb34
|
@ -307,14 +307,6 @@ class crm_case(object):
|
|||
else:
|
||||
return {'value': {'phone': address.phone}}
|
||||
|
||||
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context=None):
|
||||
thread_pool = self.pool.get('email.thread')
|
||||
return thread_pool.history(cr, uid, cases, keyword, history=history,\
|
||||
subject=subject, email=email, \
|
||||
details=details, email_from=email_from,\
|
||||
message_id=message_id, attach=attach, \
|
||||
context=context)
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""Opens Case
|
||||
@param self: The object pointer
|
||||
|
@ -325,7 +317,7 @@ class crm_case(object):
|
|||
"""
|
||||
|
||||
cases = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, cases, _('Open'))
|
||||
self.history(cr, uid, cases, _('Open'))
|
||||
for case in cases:
|
||||
data = {'state': 'open', 'active': True}
|
||||
if not case.user_id:
|
||||
|
@ -346,7 +338,7 @@ class crm_case(object):
|
|||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Close'))
|
||||
self.history(cr, uid, cases, _('Close'))
|
||||
self.write(cr, uid, ids, {'state': 'done',
|
||||
'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
})
|
||||
|
@ -377,7 +369,7 @@ class crm_case(object):
|
|||
raise osv.except_osv(_('Error !'), _('You can not escalate, You are already at the top level regarding your sales-team category.'))
|
||||
self.write(cr, uid, [case.id], data)
|
||||
cases = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, cases, _('Escalate'))
|
||||
self.history(cr, uid, cases, _('Escalate'))
|
||||
self._action(cr, uid, cases, 'escalate')
|
||||
return True
|
||||
|
||||
|
@ -391,7 +383,7 @@ class crm_case(object):
|
|||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Cancel'))
|
||||
self.history(cr, uid, cases, _('Cancel'))
|
||||
self.write(cr, uid, ids, {'state': 'cancel',
|
||||
'active': True})
|
||||
self._action(cr, uid, cases, 'cancel')
|
||||
|
@ -410,7 +402,7 @@ class crm_case(object):
|
|||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Pending'))
|
||||
self.history(cr, uid, cases, _('Pending'))
|
||||
self.write(cr, uid, ids, {'state': 'pending', 'active': True})
|
||||
self._action(cr, uid, cases, 'pending')
|
||||
return True
|
||||
|
@ -425,7 +417,7 @@ class crm_case(object):
|
|||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Draft'))
|
||||
self.history(cr, uid, cases, _('Draft'))
|
||||
self.write(cr, uid, ids, {'state': 'draft', 'active': True})
|
||||
self._action(cr, uid, cases, 'draft')
|
||||
return True
|
||||
|
@ -498,7 +490,6 @@ class crm_case(object):
|
|||
openobject_id=str(case.id),
|
||||
attach=attach_to_send
|
||||
)
|
||||
self._history(cr, uid, [case], _('Send'), history=True, subject=subject, email=dest, details=body, email_from=src)
|
||||
return True
|
||||
|
||||
def _check(self, cr, uid, ids=False, context=None):
|
||||
|
|
|
@ -125,7 +125,7 @@ this if you want the rule to send an email to the partner."),
|
|||
|
||||
# Put state change by rule in communication history
|
||||
if hasattr(obj, 'state') and action.act_state:
|
||||
model_obj._history(cr, uid, [obj], _(action.act_state))
|
||||
model_obj.history(cr, uid, [obj], _(action.act_state))
|
||||
|
||||
model_obj.write(cr, uid, [obj.id], write, context)
|
||||
emails = []
|
||||
|
|
|
@ -148,7 +148,7 @@ class crm_merge_opportunity(osv.osv_memory):
|
|||
subject = subject[0] + ", ".join(subject[1:])
|
||||
details = "\n\n".join(details)
|
||||
|
||||
opp_obj._history(cr, uid, [first_opportunity], subject, details=details)
|
||||
opp_obj.history(cr, uid, [first_opportunity], subject, details=details)
|
||||
#data.update({'message_ids' : [(6, 0 ,self._concat_o2m('message_ids', op_ids))]})
|
||||
opp_obj.write(cr, uid, [first_opportunity.id], data)
|
||||
unlink_ids = map(lambda x: x.id, tail_opportunities)
|
||||
|
|
|
@ -361,7 +361,7 @@ class project_issue(crm.crm_case, osv.osv):
|
|||
else:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot escalate this issue.\nThe relevant Project has not configured the Escalation Project!'))
|
||||
self.write(cr, uid, [case.id], data)
|
||||
self._history(cr, uid, cases, _('Escalate'))
|
||||
self.history(cr, uid, cases, _('Escalate'))
|
||||
return True
|
||||
|
||||
def message_new(self, cr, uid, msg, context=None):
|
||||
|
|
|
@ -120,30 +120,22 @@ class project_tasks(osv.osv):
|
|||
return len(res) and res[0] or False
|
||||
return res
|
||||
|
||||
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context=None):
|
||||
thread_pool = self.pool.get('email.thread')
|
||||
return thread_pool.history(cr, uid, cases, keyword, history=history,\
|
||||
subject=subject, email=email, \
|
||||
details=details, email_from=email_from,\
|
||||
message_id=message_id, attach=attach, \
|
||||
context=context)
|
||||
|
||||
def do_draft(self, cr, uid, ids, *args, **kwargs):
|
||||
res = super(project_tasks, self).do_draft(cr, uid, ids, *args, **kwargs)
|
||||
tasks = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, tasks, _('Draft'))
|
||||
self.history(cr, uid, tasks, _('Draft'))
|
||||
return res
|
||||
|
||||
def do_open(self, cr, uid, ids, *args, **kwargs):
|
||||
res = super(project_tasks, self).do_open(cr, uid, ids, *args, **kwargs)
|
||||
tasks = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, tasks, _('Open'))
|
||||
self.history(cr, uid, tasks, _('Open'))
|
||||
return res
|
||||
|
||||
def do_pending(self, cr, uid, ids, *args, **kwargs):
|
||||
res = super(project_tasks, self).do_pending(cr, uid, ids, *args, **kwargs)
|
||||
tasks = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, tasks, _('Pending'))
|
||||
self.history(cr, uid, tasks, _('Pending'))
|
||||
return res
|
||||
|
||||
def do_close(self, cr, uid, ids, *args, **kwargs):
|
||||
|
@ -151,13 +143,13 @@ class project_tasks(osv.osv):
|
|||
tasks = self.browse(cr, uid, ids)
|
||||
for task in tasks:
|
||||
if task.state == 'done':
|
||||
self._history(cr, uid, tasks, _('Done'))
|
||||
self.history(cr, uid, tasks, _('Done'))
|
||||
return res
|
||||
|
||||
def do_cancel(self, cr, uid, ids, *args, **kwargs):
|
||||
res = super(project_tasks, self).do_cancel(cr, uid, ids, *args, **kwargs)
|
||||
tasks = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, tasks, _('Cancel'))
|
||||
self.history(cr, uid, tasks, _('Cancel'))
|
||||
return res
|
||||
|
||||
project_tasks()
|
||||
|
|
|
@ -107,7 +107,7 @@ class crm_make_sale(osv.osv_memory):
|
|||
new_ids.append(new_id)
|
||||
message = _("Opportunity '%s' is converted to Quotation.") % (case.name)
|
||||
self.log(cr, uid, case.id, message)
|
||||
case_obj._history(cr, uid, [case], _("Converted to Sales Quotation(id: %s).") % (new_id))
|
||||
case_obj.history(cr, uid, [case], _("Converted to Sales Quotation(id: %s).") % (new_id))
|
||||
|
||||
if make.close:
|
||||
case_obj.case_close(cr, uid, data)
|
||||
|
|
Loading…
Reference in New Issue