[FIX] fetchmail: incoming emails on res.users does not lead to a crash anymore, due to missing mail.thread methods in res.users. The partner is also correctly added in recipients.

bzr revid: tde@openerp.com-20121115175404-pflf7lf5s5spalbu
This commit is contained in:
Thibault Delavallée 2012-11-15 18:54:04 +01:00
commit 1201be06d0
2 changed files with 6 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class res_partner_mail(osv.Model):
if type == 'email':
partner_ids = kwargs.get('partner_ids', [])
if thread_id not in partner_ids:
partner_ids.append(thread_id)
partner_ids.append((4, thread_id))
kwargs['partner_ids'] = partner_ids
thread_id = False
return super(res_partner_mail, self).message_post(cr, uid, thread_id, body=body, subject=subject,

View File

@ -141,6 +141,11 @@ class res_users(osv.Model):
partner_id = self.pool.get('res.users').read(cr, uid, thread_id, ['partner_id'], context=context)['partner_id'][0]
return self.pool.get('res.partner').message_post(cr, uid, partner_id, context=context, **kwargs)
def message_update(self, cr, uid, ids, msg_dict, update_vals=None, context=None):
partner_id = self.pool.get('res.users').browse(cr, uid, ids)[0].partner_id.id
return self.pool.get('res.partner').message_update(cr, uid, [partner_id], msg_dict,
update_vals=update_vals, context=context)
class res_users_mail_group(osv.Model):
""" Update of res.users class