openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #07905
[Bug 932713] Re: Use context values in attrs
*** This bug is a duplicate of bug 920033 ***
https://bugs.launchpad.net/bugs/920033
** This bug has been marked a duplicate of bug 920033
6.1RC1: 'uid' not available in attrs evaluation context
--
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/932713
Title:
Use context values in attrs
Status in OpenERP Server:
New
Bug description:
Hi!
I would like to use values from the context in an "attrs" attribute,
say something like:
attrs="{invisible:[('user','!=',uid)]}"
Unfortunately it does not seem to work like that. However, it seems to
me it could be enabled really easily by modifying the
'transfer_node_to_modifiers' function in orm.py, assigning the
'locals_dict'argument of the eval to the 'context' dictionary, like
that:
def transfer_node_to_modifiers(node, modifiers, context=None, in_tree_view=False):
if node.get('attrs'):
modifiers.update(eval(node.get('attrs'),locals_dict=context))
Cheers!
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/932713/+subscriptions
References