- post_tags = []
- for tag in filter(None, tags.split(',')):
- if tag.startswith('_'): # it's a new tag
- # check that not arleady created meanwhile or maybe excluded by the limit on the search
- tag_ids = Tag.search(cr, uid, [('name', '=', tag[1:])], context=context)
- if tag_ids:
- post_tags.append((4, int(tag_ids[0])))
+ result = {}
+ for forum in self.browse(cr, uid, ids, context=context):
+ post_tags = []
+ existing_keep = []
+ for tag in filter(None, tags.split(',')):
+ if tag.startswith('_'): # it's a new tag
+ # check that not already created meanwhile or maybe excluded by the limit on the search
+ tag_ids = Tag.search(cr, uid, [('name', '=', tag[1:])], context=context)
+ if tag_ids:
+ existing_keep.append(int(tag_ids[0]))
+ else:
+ # check if user have Karma needed to create need tag
+ user = User.browse(cr, uid, uid, context=context)
+ if user.exists() and user.karma >= forum.karma_retag:
+ post_tags.append((0, 0, {'name': tag[1:], 'forum_id': forum.id}))