Odoo Help


Custom addon access rights

Ucet Kxud
on 7/22/14, 11:02 AM 3,263 views

I am trying to create a custom addon in openerp v.7. I want to give read access rights to a group in my ir.model.access.csv:

test_access_hr_employee,test employee access,hr.employee,group_test_employee,1,0,0,0
test_access_hr_leave,test leave access,hr.holidays,group_test_employee,1,0,0,0

The first record for model hr.employee works fine, but when I add the second line for model hr.holidays I get the error Line 2 : No matching record found for external id 'hr.holidays' in field 'Object'

I have installed the leave management addon and I see the model hr.holidays in Technical - Database Structure - Models. Does anybody know why this happens?


Adding the module name doesn't seem to help...

Ucet Kxud
on 7/23/14, 5:23 AM
On 7/22/14, 11:47 AM

As I know you should add the modul name in the permisson.

please see this, and just copy and modify what you want...:

access_hr_holydays_status_user,hr.holidays.status user,model_hr_holidays_status,base.group_hr_user,1,1,1,1
access_hr_holydays_status_employee,hr.holidays.status employee,model_hr_holidays_status,base.group_user,1,0,0,0

  • id = unique identify for the permission (Example: MY_MODULE_res_partner_manager)
  • name = unique name for the permission (Example: res_partner manager)
  • model_id/id = the model unique name of the class you want apply permission on (Example model_res_partner)
  • group_id/id = group permission apply on (yopu can define it in xml group file or call an existing group with syntax module.group_id)
  • perm_read,perm_write,perm_create,perm_unlink = the 4 values for the relative permission to read, write,create,unlink record on defined class. 1 is True (you can do this action) and 0 is Faslse (you can't)




Ucet Kxud
On 7/23/14, 5:52 AM

I had to replace model name from 'hr.holidays' to 'model_hr_holidays'. I am n00b, I don't understand why I had to do that. Maybe someone is kind enough to explain...

I refresh my answer. Bye.

on 7/23/14, 11:03 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/22/14, 11:02 AM
Seen: 3263 times
Last updated: 6/11/18, 5:13 AM