This question has been flagged
1 Reply
3963 Views

Here is my ir.model.access.csv file:

name,group_id,perm_read,perm_write,perm_create,perm_unlink
group_scheduleb_manager,group_scheduleb_manager,TRUE,TRUE,TRUE,FALSE
group_scheduleb_user,base.group_user,TRUE,FALSE,FALSE,FALSE

When I restart the server and update my module, I see this error:

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

The group "group_scheduleb_manager" shows up correctly.  I created that in XML.  I just can't get the access lists to go through.  Any ideas?

Avatar
Discard
Best Answer

There are two missing fields: id and model_id.  Here is a snippet from account module's:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_product_product_account_user,product.product.account.user,product.model_product_product,group_account_user,1,0,0,0

Use 1 and 0 instead of TRUE and FALSE.

Avatar
Discard
Author

I had copied the CSV headers from another module. Don't remember which one. The 'id' field, I assume, is what will be the External ID for the new access list, and I can just make up anything I like, correct? I'm still getting an error for the model field. It says, " No matching record found for external id 'mymod.scheduleb' in field 'Object'. The table I'm trying to provide access to is "mymod_scheduleb". I've tried every combination of identifiers I can think of. How do I know what to put in that spot?

Author

Aha! It's working! Looks like you have to preface your table name with "model_"?

Yes, the id field will became the XML/External ID of that particular record. And yes, iIn OpenERP the XML/External ID of all models will be the model name prefixed with model_ (e.g. account_account --> model_account_account).