[FIX] mail: fixed subtype check broken by get_object refactoring, should be fixed now + updated other call to get_object

bzr revid: tde@openerp.com-20131206101117-atlch4ea102a4gx0
This commit is contained in:
Thibault Delavallée 2013-12-06 11:11:17 +01:00
parent 4eec5e416c
commit 1e5432edec
1 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ class mail_thread(osv.AbstractModel):
def read_followers_data(self, cr, uid, follower_ids, context=None):
result = []
technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one')
technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one', context=context, check_existence_and_raise=True)
for follower in self.pool.get('res.partner').browse(cr, uid, follower_ids, context=context):
is_editable = uid in map(lambda x: x.id, technical_group.users)
is_uid = uid in map(lambda x: x.id, follower.user_ids)
@ -496,9 +496,9 @@ class mail_thread(osv.AbstractModel):
posted = False
for subtype in subtypes:
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context)
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context, check_existence_and_raise=False)
if not subtype_rec.exists():
_logger.debug('subtype %s not found, giving error "%s"' % (subtype, e))
_logger.debug('subtype %s not found' % subtype)
continue
message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)
self.message_post(cr, uid, browse_record.id, body=message, subtype=subtype, context=context)