Skip to Content
Menu
This question has been flagged
2 Replies
4284 Views

i am trying to create to this file but dont know where to create and what should be written in the file.

Avatar
Discard

in my dev i work with this code
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_name_model_user,name.model.user,model_name_model,base.group_user,1,1,1,0

define it in the __manifest__.py ==> 'security/ir.model.access.csv',

Best Answer

Hi,

If you are looking to learn about the access rights in Odoo, please see this tutorial explaining the same in Odoo:  https://www.youtube.com/watch?v=r11U1pqGqQQ&list=PLqRRLx0cl0hoZM788LH5M8q7KhiXPyuVU&index=9


And for the full Odoo development tutorials from scratch:  Odoo Development Tutorials

Thanks

Avatar
Discard
Author

Thanks you, appreciate a lot.

Author Best Answer

Thankyou for helping,

but i tried creating the data folder in the custom module estate (as per chapter 4) and inside it i created the data folder, in it i created the ir.model.access.csv file (as per chapter 5).

in my data/ir.model.access.csv file i wrote:

"id","name", "model_id:id" ,"group_id:id","perm_read","perm_write","perm_create","perm_unlink"
access_test_db, access_test_db, model_test_db, base.group_user, 1,1,1,0

then i define it in the manifest file as: 

{
​'name': "Real Estate",
​'depends':['base'],
​'installable': True,
​'application':True,
​'license': 'LGPL-3',
​'data': ['data/ir.model.access.csv']
}

then if i start the server i get the error

2023-02-05 03:21:39,301 4836 WARNING testdb odoo.modules.loading: Transient module states were reset 
2023-02-05 03:21:39,301 4836 ERROR testdb odoo.modules.registry: Failed to load registry
2023-02-05 03:21:39,301 4836 CRITICAL testdb odoo.service.server: Failed to initialize database `testdb`.
Traceback (most recent call last):
File "/home/odoo/odoo/community/odoo/service/server.py", line 1289, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "", line 2, in new
File "/home/odoo/odoo/community/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/odoo/community/odoo/modules/registry.py", line 91, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/odoo/community/odoo/modules/loading.py", line 478, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/home/odoo/odoo/community/odoo/modules/loading.py", line 371, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/odoo/community/odoo/modules/loading.py", line 230, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/home/odoo/odoo/community/odoo/modules/loading.py", line 71, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/home/odoo/odoo/community/odoo/tools/convert.py", line 756, in convert_file
convert_csv_import(cr, module, pathname, fp.read(), idref, mode, noupdate)
File "/home/odoo/odoo/community/odoo/tools/convert.py", line 798, in convert_csv_import
result = env[model].load(fields, datas)
File "/home/odoo/odoo/community/odoo/models.py", line 1108, in load
if isinstance(model_fields[field_path[0]], odoo.fields.Many2one):
KeyError: ' "model_id'


Avatar
Discard