I have a situation here. I am using OpenERP 7. I am trying to hide Create button from tree view of my products. this can be done using
<tree create="false" .....
but situation is like. i want to keep it when user opens the tree view directly from "Asset Management" Module. But hide it when i click on Reporting for treeview.
I tried to use context like this from reporting button's function:
context['prod1']='false'
ctx = dict(context)
print ctx['prod1']
return {
'type': 'ir.actions.act_window',
'res_model': 'product.product',
'view_type': 'form',
'view_mode': 'tree,form',
'target': 'current',
'context':ctx,
'create':False,
'domain':[('id','in',domain)]
}
and in treeview form I did:
<tree create="context.get('prod1',False)"
but I get this json related error:
ERROR : SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
this stuff is working with my button but not with my tree view. I tried adding 'create':False
in return too, but unable to do what I want to. What am I missing?