Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Why does this security rule not work? (No matching record found for external id 'model_project_project')

By
Yenthe
on 2/10/16, 4:23 AM 1,433 views

Hi guys,


I have a strange issue regarding a new security rule that I've added.
Under __openerp__.py I added a dependency to the following modules:

'depends': ['website_portal', 'project_issue', 'website_project_issue', 'project']


I then created a new CSV for the security rules (named ir.model.access.csv) with the following rule:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

"access_project_project_public_access","Public user access to project.project","model_project_project","base.group_portal",1,1,1,0

When I now try to install / update the module I will get the following error:

Exception: Module loading my_custom_module failed: file my_custom_module/security/ir.model.access.csv could not be processed:

Line 4 : No matching record found for external id 'model_project_project' in field 'Object'

Why do I get this? I have a dependency on the project module, it is installed and a very similar security rule for project.issue works fine:

access_project_issue_public_access","Public user access to project.issue","model_project_issue","base.group_portal",1,1,1,


So what is wrong with this?

Thanks,
Yenthe

3

Axel Mendoza

--Axel Mendoza--
10205
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 2/10/16, 4:36 AM

If the model it's not defined in the same module of the ir.model.access.csv then you need to specify the module when defining the security line,

like in the module portal_project:

access_project,project,project.model_project_project,base.group_portal,1,0,0,0

For your case is the same:

"access_project_project_public_access","Public user access to project.project","project.model_project_project","base.group_portal",1,1,1,0

Also the "..." are not necessary, the separator is the comma

Wow, that was a really stupid mistake there, sorry.. @Axel what I do find strange is that my other security rule for the model project.issue is working fine without adding project. in front of it, why is this the case? Could this be because I have an inherit of project.issue in one of my Python files?

Yenthe
on 2/10/16, 4:47 AM

That's the only reason that I could imagine for that

Axel Mendoza
on 2/10/16, 4:51 AM

Interesting that this one option slipped through, I'm going to guess it comes because of the inherit. This set me on the wrong side and never made me think about adding the external module name in front of it. Thank you Axel.

Yenthe
on 2/10/16, 5:06 AM

I found myself, in the exact situation. I found success with an inherited module and could not for the life of me understand why other modules (not inherited) would not allow me to alter their permissions. Great job Axel

Phillip
on 7/29/16, 1:05 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/10/16, 4:23 AM
Seen: 1433 times
Last updated: 5/3/16, 4:38 AM