← Back to team overview

openerp-india team mailing list archive

[Bug 920033] Re: 6.1RC1: 'uid' not available in attrs evaluation context

 

Hello ,

I am still face the same problem with web as well as gtk. 
when use attrs="{'invisible':[('user_id','=',uid)]}"

I have face following traceback

Environment Information : 
System : Linux-2.6.32-21-generic-i686-with-Ubuntu-10.04-lucid
OS Name : posix
Distributor ID:	Ubuntu
Description:	Ubuntu 10.04.3 LTS
Release:	10.04
Codename:	lucid
Operating System Release : 2.6.32-21-generic
Operating System Version : #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : en_IN.ISO8859-1
Python Version : 2.6.5
OpenERP-Client Version : 6.1
Last revision No. & ID :2050 launchpad_translations_on_behalf_of_openerp-20120219054202-yts5mlg7pe20l36a
Traceback (most recent call last):
  File "/home/jir/workspace/trunk6/server/openerp/wsgi/core.py", line 79, in xmlrpc_return
    result = openerp.netsvc.dispatch_rpc(service, method, params)
  File "/home/jir/workspace/trunk6/server/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/jir/workspace/trunk6/server/openerp/service/web_services.py", line 572, in dispatch
    res = fn(db, uid, *params)
  File "/home/jir/workspace/trunk6/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/jir/workspace/trunk6/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/jir/workspace/trunk6/server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 2149, in fields_view_get
    xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 1789, in __view_look_dom_arch
    fields_def = self.__view_look_dom(cr, user, node, view_id, False, fields, context=context)
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 1738, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context))
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 1738, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context))
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 1738, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context))
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 1738, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context))
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 1709, in __view_look_dom
    transfer_node_to_modifiers(node, modifiers, context, in_tree_view)
  File "/home/jir/workspace/trunk6/server/openerp/osv/orm.py", line 99, in transfer_node_to_modifiers
    modifiers.update(eval(node.get('attrs')))
  File "/home/jir/workspace/trunk6/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
NameError: name 'uid' is not defined


** Project changed: openerp-web => openobject-server

** Changed in: openobject-server
    Milestone: 6.1 => None

** Changed in: openobject-server
   Importance: Undecided => Medium

** Changed in: openobject-server
       Status: Fix Released => Confirmed

** Changed in: openobject-server
     Assignee: OpenERP R&D Web Team (openerp-dev-web) => OpenERP's Framework R&D (openerp-dev-framework)

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/920033

Title:
  6.1RC1: 'uid' not available in attrs evaluation context

Status in OpenERP Server:
  Confirmed

Bug description:
  When I try to compare the logged in user with the user_id stored on
  the database to run time display a field or button using
  attrs="{'invisible':[('user_id','=',uid)]}", it does not work.

  Was working in previous versions. Please suggest a fix.

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


References