I've created a new module named event_extended, which depends on the module named event. In my module, I've created a class ee.diploma. I created a new menu option to access to the views of this projects:
<menuitem name="Diplomas"
id="menu_action_event_diploma" parent="base.menu_event_main"
action="action_event_diploma" sequence="11"
groups="event.group_event_manager,event.group_event_user"/>
As you can see, I've set some groups to the menuitem: I copied them from other existing menuitem which was set on the event module code. I did this because I want my menu option to bevahe like that menuitem.
As I want to use the same user groups as the ones declared in the module event, I didn't create any XML file in the security folder. I've only created a CSV file (which I've included in the array data of __openerp__.py). This is my CSV:
id, name, model_id:id, group_id:id, perm_read, perm_write, perm_create, perm_unlink
access_ee_diploma, ee.diploma, model_ee_diploma, event.group_event_user, 1, 1, 1, 1
The problem is: I can't see the menu option if I'm logged as a normal user (it doesn't mind if my user belongs to event.group_event_manager or event.group_event_user).
Can anyone help me, please? I've seen several questions which ask the same as I do, and I've tried their answers with no result. There must be something I'm missing.
EDIT
The rows I write in my CSV are being ignored. I have the next structure in my module
event_extended
|_ controllers
|_ i18n
|_ report
|_ security
|_ static
|_ wizard
|_ __openerp__.py
... etc
And my __openerp__.py is:
{
"name": "Extended Events",
"version": "0.1",
"depends": [
"web",
"event",
"res_partner_extended",
],
"author": "Juan Formoso <xxx@xxx.es>",
"category": "Events",
"description": """
Later.
""",
'demo': [],
'data': [
'security/ir.model.access.csv',
'event_view.xml',
'event_registration_view.xml',
'res_partner_view.xml',
'wizard/add_partner_to_event_view.xml',
'reports.xml',
],
'installable': True,
}
If you got to your settings menu, in the event user group, is the menu defined? Also, under the access rules, is the line created that you made in your CSV? Just regular checks. I have experienced the same sort of error before but did not find a solution. Also, this might sound stupid, but did you try to remove the "parent" tag from the menu item? If you do, your menu item will appear in the top bar. If THAT occurs, then we have the exact same problem and I would be more than curious to find the solution as well.
Thank you very much @Ludo! I did what you said, removed the parent tag and my menu item appears on the top bar, but once again, only for admin, not for non admin users.
If I go to Settings -> Technical -> Security -> Access Controls List, I can't see the row I added in my CSV file. Why?
Are you 100% sure that you added the CSV file to the __openerp__.py file of your module? Otherwise, the CSV contents might not be valid. Try adding a second line for the event manager group as well.
The problem must be that I'm not adding the access rights properly, because I've just created a new record from the interface with the data of my CSV row, and now, it works. Is my CSV file wrong?
Ok, I'll do it now!
I added a second line in my CSV for event.group_event_manager with the same permissions, and it's beeing ignored too. I'm going to edit my question to show my __openerp__.py and module folder structure.
Not quite sure if it makes a difference, but in my configurations the csv file is always the last file of the "update" column, not the "data" column. Also, as Aitor mentioned you should use commas, but my assumption is that you just used those here to clarify what was filled in?
Ok, I've been said to remove the update_xml and use data instead (I'm working on v7). But I'm having the same problem. I'm not using slashes (I've only written them here to show my CSV content). I copied a CSV from other module, opened and modified it with LibreOffice.