İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
1142 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Mar 15
5198
1
Şub 25
1110
1
Tem 22
7378
0
Kas 16
5264
2
Mar 15
6641