diff --git a/addons/idea/wizard/idea_post_vote.py b/addons/idea/wizard/idea_post_vote.py index b54c007549de3a2ce0491d1bc91cf04748196840..df35f42cc33d8d5d824973c515e47700d9a5047e 100644 --- a/addons/idea/wizard/idea_post_vote.py +++ b/addons/idea/wizard/idea_post_vote.py @@ -73,12 +73,14 @@ class idea_post_vote(osv.osv_memory): """ idea_obj = self.pool.get('idea.idea') vote_obj = self.pool.get('idea.vote') + + ctx_key = 'idea_ids' if context.get('idea_ids') is not None else 'active_ids' - for idea in idea_obj.browse(cr, uid, context.get('active_ids', []), context=context): + for idea in idea_obj.browse(cr, uid, context.get(ctx_key, []), context=context): - for active_id in context.get('active_ids'): + for idea_id in context.get(ctx_key): - vote_ids = vote_obj.search(cr, uid, [('user_id', '=', uid), ('idea_id', '=', active_id)]) + vote_ids = vote_obj.search(cr, uid, [('user_id', '=', uid), ('idea_id', '=', idea_id)]) vote_obj_id = vote_obj.browse(cr, uid, vote_ids) count = 0 for vote in vote_obj_id: @@ -166,7 +168,7 @@ class idea_select(osv.osv_memory): 'views': [(id2, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')], 'type': 'ir.actions.act_window', 'target': 'new', - 'context': {'active_ids': [idea_id]} + 'context': {'idea_ids': [idea_id]} } return value