Permalink
Browse files

[FIX] openerp-web 6.1 - server action

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...
1 parent c772f83 commit b419f7a4cf4878f35ff6b753ef336ab8925f47ba @eLBati eLBati committed Apr 10, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 serveraction.py
View
@@ -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

0 comments on commit b419f7a

Please sign in to comment.