[FIX]crm : fixed bug in mailgate after apply inherit in crm meeting

bzr revid: hmo@tinyerp.com-20100201134159-dl0mrbahkyaoyfwu
This commit is contained in:
Harry (Open ERP)
2010-02-01 19:11:59 +05:30
parent b1d481692e
commit 86f8f169c9
2 changed files with 5 additions and 12 deletions
+2 -9
View File
@@ -580,7 +580,7 @@ class crm_case(osv.osv):
def __history(self, cr, uid, cases, keyword, history=False, email=False, details=None, context={}):
model_obj = self.pool.get('ir.model')
model_obj = self.pool.get('ir.model')
for case in cases:
model_ids = model_obj.search(cr, uid, [('model','=',case._name)])
data = {
@@ -820,14 +820,7 @@ class crm_case_history(osv.osv):
_name = "crm.case.history"
_description = "Case history"
_order = "id desc"
_inherits = {'crm.case.log':"log_id"}
def create(self, cr, user, vals, context=None):
if vals.has_key('res_id') and vals['res_id']:
case_obj = self.pool.get(vals['model_id'])
cases = case_obj.browse(cr, user, [vals['res_id']])
case_obj._action(cr, user, cases, '')
return super(crm_case_history, self).create(cr, user, vals, context)
_inherits = {'crm.case.log':"log_id"}
def _note_get(self, cursor, user, ids, name, arg, context=None):
res = {}
+3 -3
View File
@@ -49,9 +49,9 @@ class crm_cases(osv.osv):
res = mailgate_obj.partner_get(cr, uid, msg['From'])
if res:
data.update(res)
res = self.create(cr, uid, data)
res = self.create(cr, uid, data)
cases = self.browse(cr, uid, [res])
self.__history(cr, uid, cases, _('Receive'), history=True, email=msg['From'])
self._history(cr, uid, cases, _('Receive'), history=True, email=msg['From'])
return res
def msg_update(self, cr, uid, ids, msg, data={}, default_act='pending'):
@@ -80,7 +80,7 @@ class crm_cases(osv.osv):
res = self.write(cr, uid, ids, data)
cases = self.browse(cr, uid, [res])
self.__history(cr, uid, cases, _('Receive'), history=True, email=msg['From'])
self._history(cr, uid, cases, _('Receive'), history=True, email=msg['From'])
getattr(self,act)(cr, uid, ids)
return res