← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 851716] Re: [Trunk] UnboundLocalError: local variable 'obj_pool' referenced before assignment

 

Ok, after some update and search, it still happens. You can see here :

http://bazaar.launchpad.net/~openerp/openobject-
server/trunk/view/head:/openerp/addons/base/ir/ir_actions.py#L628

That if the if is not True, obj = None. That's what happends on my side,
using the latest GTK Client. Same with the "old" web client. I got the
following error :

Traceback (most recent call last):
  File "/home/thibaut/OpenERP 6/Logica/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/thibaut/OpenERP 6/Logica/server/openerp/osv/osv.py", line 175, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/thibaut/OpenERP 6/Logica/server/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/thibaut/OpenERP 6/Logica/server/openerp/addons/base/ir/ir_actions.py", line 669, in run
    eval(action.code, cxt, mode="exec", nocopy=True) # nocopy allows to return 'action'
  File "/home/thibaut/OpenERP 6/Logica/server/openerp/tools/safe_eval.py", line 286, in safe_eval
    return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 2, in <module>
AttributeError: 'NoneType' object has no attribute 'pool'


Here is the action code that is eval'd :

     action = obj.pool.get('ir.actions.todo').action_launch(cr, uid,
[1], context=context)

So, it'sz clear that "obj" is None. This happends when I click on the
"Add new features" action.

** Changed in: openobject-server
       Status: Invalid => Incomplete

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/851716

Title:
  [Trunk] UnboundLocalError: local variable 'obj_pool' referenced before
  assignment

Status in OpenERP Server:
  Incomplete

Bug description:
  Using the latest trunk, I created an action in the right panel :

  <record id="action_appel_fiche" model="ir.values">
              <field name="object" eval="1" />
              <field name="name">Appel Fiche</field>
              <field name="key2">client_action_multi</field>
              <field name="value" eval="'ir.actions.server,%d'%oa_partner_client_act_serv_appel_fiche"/>
              <field name="key">action</field>
              <field name="model">oa.partner.client</field>
  </record>

  When I click on my action, I got this :

  Traceback (most recent call last):
    File "/home/thibaut/OpenERP 6/Logica/server/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/thibaut/OpenERP 6/Logica/server/openerp/osv/osv.py", line 175, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/thibaut/OpenERP 6/Logica/server/openerp/osv/osv.py", line 166, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/thibaut/OpenERP 6/Logica/server/openerp/addons/base/ir/ir_actions.py", line 632, in run
      'self': obj_pool,
  UnboundLocalError: local variable 'obj_pool' referenced before assignment

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/851716/+subscriptions


References