Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
1141 Vues

Hi, im using odoo18, and i created a new module named formation. And i added this security but i got the error "Missing required value for the field 'Object' (model_id)" when i import the module to odoo. 


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

access_formation_courses,formation.courses,model_formation_courses,base.group_user,1,1,1,1

access_formation_trainers,formation.trainers,model_formation_trainers,base.group_user,1,1,1,1

access_formation_worker,formation.worker,model_formation_worker,base.group_user,1,1,1,1

access_training_action,training.action,model_training_action,base.group_user,1,1,1,1


The models are named: 

 _name = 'formation_courses'

_name = 'formation_worker'

_name = 'formation_trainers'

_name = 'training_action'


Thanks for your help in advance!

Avatar
Ignorer
Meilleure réponse

Hi,
Can you confirm that the file containing the models are imported in the init file and service is restarted after adding the models ? Ensuring the above may solve the issue. 

Right now the system is not able to see the models in the env and thus exception is raised.
Thanks

Avatar
Ignorer
Meilleure réponse

Hi,

First, make sure the model is loaded. You can check this in the Settings->Technical-> Models. Also, ensure that you've added the model's file name in the __init__.py file inside the models folder. 

Similarly, make sure the models folder is added in the main __init__.py file.

Please check the following blog or more details:

https://www.cybrosys.com/blog/how-to-create-security-group-and-manage-access-rights-in-odoo-18


Hope it helps

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
mars 15
5197
1
févr. 25
1107
1
juil. 22
7372
0
nov. 16
5264
2
mars 15
6640