تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1147 أدوات العرض

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!

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 15
5207
1
فبراير 25
1132
1
يوليو 22
7393
0
نوفمبر 16
5281
2
مارس 15
6641