title: Creating security groups for a custom module in odoo 10
body: <p>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:</p>
  
  <p>I created a file security.xml in my security folder with contain the following</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;odoo&gt;
  &lt;data noupdate="0"&gt;
     &lt;!-- Creating a Group Category --&gt;        
     &lt;record id="evaluation_subj" model="ir.module.category"&gt;
         &lt;field name="name"&gt;evaluation subjective&lt;/field&gt;
         &lt;field name="sequence"&gt;1&lt;/field&gt;
     &lt;/record&gt;
     &lt;!-- Adding a Group to the Group Category --&gt;
     &lt;record id="group_eval_subj" model="res.groups"&gt;
         &lt;field name="name"&gt;Groupe Evaluation Subjective&lt;/field&gt;
         &lt;field name="evaluation_subj" ref="evaluation subjective"/&gt;
         &lt;!-- Adding Rights of existing Groups --&gt;
         &lt;field name="implied_ids"
                eval="[(4, ref('base.group_system')), 
       (4,ref('base.group_sale_manager'))]"/&gt;
     &lt;/record&gt;
    &lt;/data&gt;
   &lt;/odoo&gt; 
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>&lt;menuitem name="Parties Prenantes" id="pnc_evaluation_stakeholders"
           action="pncevaluation_partieprenante" parent="pnc_documents" sequence="40" groups="base.group_system"/&gt;
  </code></pre>
  
  <p>Then in csv file of my security folder I added this : </p>
  
  <pre><code>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
  </code></pre>
  
  <p>When I updated my module I have an error saying "csv file could not be proccessed"</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>The <a href="https://stackoverflow.com/questions/44222078/custom-module-and-creating-groups-in-odoo-10">link</a> to my previous question.</p>