Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
1136 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 15
5197
1
feb 25
1107
1
lug 22
7370
0
nov 16
5263
2
mar 15
6639