I have a problem with a module of odoo 12 it dosn't add access rights

606 Views Asked by At

Please help. I'm just starting with odoo 12 I have 4 models declared on the same file and I'm importing 2 other models there too, all good until there, but when I add access rights to the ir.model.access.csv file it doesn't do anything, I already uncommented that on my manifest but it didn't changed anything this is what I'm writing on my csv file

id,name,model_id:id,group_id:id, perm_read, perm_write, perm_create, perm_unlink    
access_municipio,municipio contacto,model_municipio,base.group_user,1,1,1,1
access_comarca,comarca contacto,model_comarca,base.group_user,1,1,1,1
access_distrito,distrito contacto,model_distrito,base.group_user,1,1,1,1
access_barrio,barrio contacto,model_barrio,base.group_user,1,1,1,1
1

There are 1 best solutions below

2
On

The header is missing, Odoo will fail to convert and import the CSV file. When the id field name is not specified in the header, Odoo will just log an error message and ignore the importation.

You should see the following error message in the log:

ERROR db_name odoo.tools.convert: Import specification does not contain 'id' and we are in init mode, Cannot continue.

Try to add the following header:
csv id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink