I have created a custom module on odoo 10. Now I wanted to create security groups with users where each group have a particular menu of my custom module. I've already asked this question and I followed the answers that I got but I did not get the results (I definitely messed up at some point but I can't see where, this is my first time working with odoo) so I ask again the question. Here's what I did:
I created a file security.xml in my security folder with contain the following
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- Creating a Group Category -->
<record id="evaluation_subj" model="ir.module.category">
<field name="name">evaluation subjective</field>
<field name="sequence">1</field>
</record>
<!-- Adding a Group to the Group Category -->
<record id="group_eval_subj" model="res.groups">
<field name="name">Groupe Evaluation Subjective</field>
<field name="evaluation_subj" ref="evaluation subjective"/>
<!-- Adding Rights of existing Groups -->
<field name="implied_ids"
eval="[(4, ref('base.group_system')),
(4,ref('base.group_sale_manager'))]"/>
</record>
</data>
</odoo>
Then in the file pnc_menus.xml (I have a file called pnc_menus.xml where I created all of my menus) I added the groups field to this menu:
<menuitem name="Parties Prenantes" id="pnc_evaluation_stakeholders"
action="pncevaluation_partieprenante" parent="pnc_documents" sequence="40" groups="base.group_system"/>
Then in csv file of my security folder I added this :
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
eval_group,groupe_evaluation,pnc_evaluation_stakeholders,group_eval_subj,1,1,1,1
When I updated my module I have an error saying "csv file could not be proccessed"
In the log file I have this:
`Exception: Module loading pncevaluation failed: file pncevaluation\security/ir.model.access.csv could not be processed:
Aucun enregistrement trouv\xe9 pour id externe 'group_eval_subj' dans le champ 'Group'
ERREUR: une instruction insert ou update sur la table \xab ir_model_access \xbb viole la contrainte de cl\xe9
\xe9trang\xe8re \xab ir_model_access_model_id_fkey \xbb
DETAIL: La cl\xe9 (model_id)=(559) n'est pas pr\xe9sente dans la table \xab ir_model \xbb.
File "D:\Odoo 10.0\server\odoo\tools\convert.py", line 898, in convert_csv_import
raise Exception(_('Module loading %s failed: file %s could not be processed:\n %s') % (module, fname, warning_msg))
Exception: Module loading pncevaluation failed: file pncevaluation\security/ir.model.access.csv could not be processed:
Aucun enregistrement trouv\xe9 pour id externe 'group_eval_subj' dans le champ 'Group'
ERREUR: une instruction insert ou update sur la table \xab ir_model_access \xbb viole la contrainte de cl\xe9
\xe9trang\xe8re \xab ir_model_access_model_id_fkey \xbb
DETAIL: La cl\xe9 (model_id)=(559) n'est pas pr\xe9sente dans la table \xab ir_model \xbb.
The link to my previous question.