我有一个以这种方式定义的模块:
class ProjectVersion(models.Model):
_name = 'project.version' ...
和菜单项:
<act_window id="action_project_versions"
name="Project versions"
res_model="project.version"
view_mode="tree,form" />
<menuitem id="menu_project_version"
parent="project.menu_project_config"
name="Versions"
action="action_project_versions"
sequence="4" />
我有一个文件ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_project_version_user,project.version user,model_project_version,project.group_project_user,1,0,0,0
access_project_version_manager,project.version manager,model_project_version,project.group_project_manager,1,1,1,1
拥有uid&gt;的用户1没有看到新的菜单项,也无法在表单视图中编辑版本字段(
出现访问错误“您无法访问请求的文档...型号: project.version“
),新规则也未在设置&gt;技术&gt;安全&gt;访问控制列表
中提升什么是我的文件ir.model.access.csv?
答案 0 :(得分:0)
在我的情况下,只有我在设置Acess控件列表中手动创建它才有效。然后我删除手动创建的访问控制列表。 导出文件内容:
"id","name","model_id/id","group_id/id","perm_write","perm_create","perm_unlink","perm_read"
"__export__.ir_model_access_484","access_project_version manager","project_version.model_project_version","project.group_project_manager","True","True","True","True"
"__export__.ir_model_access_485","access_project_version user","project_version.model_project_version","project.group_project_user","False","False","False","True"
我用
替换了第一个colunm"access_project_version_manager"
"access_project_version_user"
我已将新的ir.model.access.csv放置在我的模块的安全文件夹中,更新了模块,现在它可以工作了!