[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
This commit is contained in:
niv-openerp 2011-10-05 11:56:33 +02:00
parent 1bbe15f634
commit 708802c357
1 changed files with 6 additions and 4 deletions

View File

@ -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