Use context values in attrs

Bug #932713 reported by Francois Degrave
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

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 post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.