Skip to content

Commit

Permalink
[FIX] openerp-web 6.1 - server action
Browse files Browse the repository at this point in the history
how to reproduce:
 - install poweremail
 - install project_timesheet
 - go to project -> time tracking -> my timesheet
get
  File "/home/elbati/workspace/openerp/6.1/server/openerp/addons/poweremail/serveraction.py", line 73, in run
    obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
KeyError: 'active_id'
  • Loading branch information
eLBati committed Apr 10, 2012
1 parent c772f83 commit b419f7a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions serveraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ def run(self, cr, uid, ids, context=None):

for action in self.browse(cr, uid, ids, context):
obj_pool = self.pool.get(action.model_id.model)
obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
cxt = {
'context':context,
'object': obj,
'time':time,
'cr': cr,
'pool' : self.pool,
'uid' : uid
}
if context.get('active_id', False):
obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
cxt['object'] = obj
expr = eval(str(action.condition), cxt)
if not expr:
continue
Expand Down

0 comments on commit b419f7a

Please sign in to comment.