From 708802c3575d5285309eb6bfb888ba583e00075c Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 5 Oct 2011 11:56:33 +0200 Subject: [PATCH] [fix] problem with the idea module trying to override the 'active_id' context key, which it should not bzr revid: nicolas.vanhoren@openerp.com-20111005095633-v53hjz3fkwlb3fso --- addons/idea/wizard/idea_post_vote.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/idea/wizard/idea_post_vote.py b/addons/idea/wizard/idea_post_vote.py index b54c007549d..df35f42cc33 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