[IMP] mail: use `has_group` to check a user is part of a group

`has_groups` is more efficient, and won't lead to useless
prefetches.

opw-634402
This commit is contained in:
Denis Ledoux 2015-05-12 12:19:47 +02:00
parent 5d4560676e
commit 417f012ce9
1 changed files with 1 additions and 2 deletions

View File

@ -182,9 +182,8 @@ 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', context=context)
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_editable = self.pool['res.users'].has_group(cr, uid, 'base.group_no_one')
is_uid = uid in map(lambda x: x.id, follower.user_ids)
data = (follower.id,
follower.name,