[MERGE] latest trunk
authorOlivier Dony <odo@openerp.com>
Tue, 13 Sep 2011 14:46:00 +0000 (16:46 +0200)
committerOlivier Dony <odo@openerp.com>
Tue, 13 Sep 2011 14:46:00 +0000 (16:46 +0200)
bzr revid: odo@openerp.com-20110913144600-ve4vb5po9vi3edw4

1  2 
openerp/addons/base/ir/ir_actions.py
openerp/addons/base/res/res_lang.py
openerp/addons/base/rng/view.rng

@@@ -622,16 -601,16 +622,18 @@@ class actions_server(osv.osv)
              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
              }
@@@ -194,7 -194,7 +194,7 @@@ class lang(osv.osv)
              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] != '%':
Simple merge