Skip to Content
Menu
This question has been flagged
1 Reply
1232 Views

this is my model : 

from odoo import models, fields
class Consultation(models.Model):    _name = 'generalAo.consultation'    _description = 'Consultation Model'
    année_soumission = fields.Date(string='Année de Soumission')    ajouté_par = fields.Char(string='Ajouté par')    date_publication = fields.Date(string='Date de Publication')    date_limite = fields.Date(string='Date Limite')    heure_limite = fields.Char(string='Heure Limite')

 and this is my application structure :

testing
┣ controllers
┃ ┣ consultationController.py
┃ ┗ __init__.py
┣ models
┃ ┣ Consultation.py
┃ ┗ __init__.py
┣ security
┃ ┗ ir.model.access.csv
┣ static
┣ views
┃ ┣ consultation.xml
┃ ┗ menu.xml
┣ __init__.py
┗ __manifest__.py

and this is the error i'm getting :

No matching record found for external id 'model_generalAo_consultation' in field 'Model'
No matching record found for external id 'base.group_manager' in field 'Group'
No matching record found for external id 'model_generalAo_consultation' in field 'Model'
Missing required value for the field 'Model' (model_id)
Missing required value for the field 'Model' (model_id)

Ps:I'm using odoo 16

Avatar
Discard
Best Answer

Hi Ahmed

Please make sure that the corresponding file is imported in the init file. Regarding the group adds base.group_user  in groups of ir.model.access.csv file 

id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_consultation,access.consultation,model_generalAo_consultation,base.group_user,1,1,1,1


check the following references 

Set Access Rights For Model In Odoo


Regards


Avatar
Discard