context = {}
user = self.pool.get('res.users').browse(cr, uid, uid)
for action in self.browse(cr, uid, ids, context):
+ obj = None
+ obj_pool = self.pool.get(action.model_id.model)
- obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
+ if context.get('active_model') == action.model_id.model and context.get('active_id'):
- obj_pool = self.pool.get(action.model_id.model)
+ obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
cxt = {
- 'context': dict(context), # copy context to prevent side-effects of eval
+ 'self': obj_pool,
'object': obj,
+ 'obj': obj,
+ 'pool': self.pool,
'time': time,
'cr': cr,
- 'pool': self.pool,
+ 'context': dict(context), # copy context to prevent side-effects of eval
'uid': uid,
'user': user
}
trans_obj.unlink(cr, uid, trans_ids, context=context)
return super(lang, self).unlink(cr, uid, ids, context=context)
-- def format(self, cr, uid, ids, percent, value, grouping=False, monetary=False):
++ def format(self, cr, uid, ids, percent, value, grouping=False, monetary=False, context=None):
""" Format() will return the language-specific output for float values"""
if percent[0] != '%':