[FIX]: changes in message_update()

bzr revid: rha@tinyerp.com-20110420081141-4w1wi70e290m2a69
This commit is contained in:
Rifakat Haradwala (Open ERP) 2011-04-20 13:41:41 +05:30
parent 280e446cef
commit 190148f759
7 changed files with 83 additions and 5 deletions

View File

@ -400,6 +400,19 @@ class crm_lead(crm_case, osv.osv):
if case.state in CRM_LEAD_PENDING_STATES:
values.update(state=crm.AVAILABLE_STATES[1][0]) #re-open
res = self.write(cr, uid, [case.id], values, context=context)
attachments = msg.get('attachments', {})
self.history(cr, uid, ids, _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
details = msg.get('body'),
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments,
email_date = msg.get('date'),
context = context)
return res
def on_change_optin(self, cr, uid, ids, optin):

View File

@ -254,6 +254,19 @@ class crm_claim(crm.crm_case, osv.osv):
if case.state in CRM_CLAIM_PENDING_STATES:
values.update(state=crm.AVAILABLE_STATES[1][0]) #re-open
res = self.write(cr, uid, [case.id], values, context=context)
attachments = msg.get('attachments', {})
self.history(cr, uid, ids, _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
details = msg.get('body'),
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments,
email_date = msg.get('date'),
context = context)
return res
crm_claim()

View File

@ -178,6 +178,19 @@ class crm_helpdesk(crm.crm_case, osv.osv):
if case.state in CRM_HELPDESK_STATES:
values.update(state=crm.AVAILABLE_STATES[1][0]) #re-open
res = self.write(cr, uid, [case.id], values, context=context)
attachments = msg.get('attachments', {})
self.history(cr, uid, ids, _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
details = msg.get('body'),
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments,
email_date = msg.get('date'),
context = context)
return res
crm_helpdesk()

View File

@ -377,6 +377,19 @@ class hr_applicant(crm.crm_case, osv.osv):
vals.update(vls)
res = self.write(cr, uid, ids, vals, context=context)
attachments = msg.get('attachments', {})
self.history(cr, uid, ids, _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
details = msg.get('body'),
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments,
email_date = msg.get('date'),
context = context)
return res
def case_open(self, cr, uid, ids, *args):

View File

@ -90,7 +90,7 @@ class email_thread(osv.osv):
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments.items(),
attach = attachments,
email_date = msg.get('date'),
context = context)
return res_id
@ -115,7 +115,7 @@ class email_thread(osv.osv):
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments.items(),
attach = attachments,
email_date = msg.get('date'),
context = context)
return True

View File

@ -454,6 +454,19 @@ class project_issue(crm.crm_case, osv.osv):
vals.update(vls)
res = self.write(cr, uid, ids, vals)
attachments = msg.get('attachments', {})
self.history(cr, uid, ids, _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
details = msg.get('body'),
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments,
email_date = msg.get('date'),
context = context)
return res
def copy(self, cr, uid, id, default=None, context=None):

View File

@ -69,7 +69,7 @@ class project_tasks(osv.osv):
return res_id
def message_update(self, cr, uid, id, msg, data={}, default_act='pending'):
def message_update(self, cr, uid, ids, msg, data={}, default_act='pending'):
thread_obj = self.pool.get('email.thread')
msg_actions, body_data = thread_obj.msg_act_get(msg)
data.update({
@ -90,8 +90,21 @@ class project_tasks(osv.osv):
if msg_actions['priority'] in ('1','2','3','4','5'):
data['priority'] = msg_actions['priority']
self.write(cr, uid, [id], data)
getattr(self,act)(cr, uid, [id])
self.write(cr, uid, ids, data)
getattr(self,act)(cr, uid, ids)
attachments = msg.get('attachments', {})
self.history(cr, uid, ids, _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
details = msg.get('body'),
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments,
email_date = msg.get('date'),
context = context)
return True
def thread_followers(self, cr, uid, ids, context=None):