Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide Create button from tree view in a specific object. As this object has all the fields readonly

How can I hide Create button from tree view in a specific object? As this object has all the fields readonly.

like image 687
StackUP Avatar asked Feb 05 '13 13:02

StackUP


1 Answers

It depends on which OpenERP version you are working, please mention it if you'd like more specific answers. If you're asking this question you're probably not using 7.0 yet, but it might be useful to know nevertheless.

OpenERP 7.0

As of OpenERP 7.0 the system will automatically do this for you for each of the following possible actions: create, edit, delete: if the current user has no access (based on the Access Rights configuration) the corresponding flag will be added to the root node of the view definition, effectively hiding the option in the UI. These flags correspond respectively to the following access rights: create, write, unlink.

As user1576199 mentioned, this flag could also be set manually in your view definition, but that should only be required when the access rights do not correspond to the options you want to show. You could do it in this manner, in any combination:

<tree create="false" delete="false">
....
</tree>
or
<kanban create="false" edit="false">
....
</kanban>
etc..

OpenERP 6.1 and earlier

There is no option to hide these buttons, so you'll need to customize the OpenERP client(s) if you want to specifically achieve that. simahawk's answer gave you some starting points for the web client 6.1, which is probably what you want to customize.

like image 135
odony Avatar answered Nov 16 '22 13:11

odony