I am working on python, xml in openerp. I am creating access right for manager and user. I want to hide "Convert to opportunity" button on user login. And show that button in manager login. how to hide this button on login user.
see the following screenshot.
I created groups for manager and user separately.
<button string="Convert to Opportunity" type="action" states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight" position="replace"/>
while i am adding this code. "Convert to Opportunity" button will be hidden. But it is hidden user and manager.
Then i tried add "groups" attribute and place my groups name. but it will give architecture error
<button string="Convert to Opportunity" type="action" states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight" group="User" position="replace"/>
what did i mistake?
First of the attribute is "groups" with s not "group".
And you have to give it group ids (xml-ids) instead of simple names.
Througout the OpenERP Code you will find many examples for this, just search for "groups=" in xml files.
some examples for group ids:
if you want already installed/created groups and their ids go into your database and look into the table ir_model_data (filter by model='res.groups'). the column "name" in that table is the xml-id you need.