Odoo Help

0

Security problem

By
Dr Obx
on 11/19/15, 4:30 AM 945 views

Guys,

I added a groups, security rules and on one machine it works but on another one it doesen't.

ir.model.access.csv

<pre>

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

"user_configurator","user_configurator","model_configurator","imerge_group_user",1,0,0,0

"manager_configurator","manager_configurator","model_configurator","imerge_group_manager",1,1,1,1

</pre>

security_menu.xml

<pre>

<?xml version="1.0" encoding="UTF-8"?>

<openerp>

<data>

<record model='ir.ui.menu' id='security_menu'>

<field name='groups_id' eval="[(4, ref('imerge_group_manager')),(4, ref('imerge_group_user'))]"/>

</record>

<record model='ir.ui.menu' id='security_list_menu1'>

<field name='groups_id' eval="[(4, ref('imerge_group_manager')),(4, ref('imerge_group_user'))]"/>

</record>

<record model='ir.ui.menu' id='security_list_menu2'>

<field name='groups_id' eval="[(4, ref('imerge_group_manager')),(4, ref('imerge_group_user'))]"/>

</record>

</data>

</openerp>

</pre>

security.xml

<pre>

<?xml version="1.0" encoding="UTF-8"?>

<openerp>

<data>

<record model='ir.module.category' id='security_module_category'>

<field name='name'>Title generator</field>

<field name='sequence'>10</field>

</record>

<record id='imerge_group_manager' model='res.groups'>

<field name='name'>Manager</field>

<field name='category_id' eval='security_module_category'/>

<field name="users" eval="[(4, ref('base.user_root'))]"/>

</record>

<record id='imerge_group_user' model='res.groups'>

<field name='name'>User</field>

<field name='category_id' eval='security_module_category'/>

<field name="users" eval="[(4, ref('base.user_root'))]"/>

</record>

</data>

</openerp>

</pre>

Can anyone tell me what I've done wrong ?

I'm getting this error:

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

Line 1 : No matching record found for external id 'imerge_group_user' in field 'Group'

1
Axel Mendoza
On 11/20/15, 12:06 AM

Check the order of the files in the data entry of the __openerp__.py dict, the file that define the group imerge_group_user need to be defined first than where the record id imerge_group_user is used in menus or ir.model.access csv entries

OMG silly Me :) Thank you Axel Problem solved :)

Dr Obx
on 11/20/15, 4:12 AM

Happy to help

Axel Mendoza
on 11/20/15, 4:15 AM

I just did not knew that the order is so important :) Now I know :) Thank you again :)

Dr Obx
on 11/20/15, 4:33 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.

Register

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)

Stats

Asked: 11/19/15, 4:30 AM
Seen: 945 times
Last updated: 11/20/15, 4:12 AM