python - 当我更改权限文件 ir.model.access.csv 并升级模块时,我有一个问题缺少字段“对象”(model_id) 的必需值
问题描述
我在 odoo 12 中创建了自己的模块。并且我更改了权限文件- ir.model.access.csv
. 所有代码如下。
ir.model.access.csv:
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_customer_customer,access.customer.customer,model_customer_customer,base.group_user,1,1,1,0
.模型/模型:
from odoo import models, fields
class CustomerCustomer(models.Model):
_name = 'customer.customer'
name = fields.Char(string= 'Name', required=True)
place = fields.Char(string='Place')
photo = fields.Binary(string='Image')
age = fields.Integer(string='Age')
dob = fields.Date(string='Date of Birth')
当我尝试升级我的模块并安装我从 odoo 12 创建的模块时出现错误消息
异常:模块加载 custom_customer 失败:文件 custom_customer\security/ir.model.access.csv 无法处理:在字段 'Object' 中找不到外部 id 'model_customer_customer' 的匹配记录缺少字段'Object'的必需值(model_id )
解决方案
请检查您是否在模型文件夹内的init .py中添加了文件名,并请检查是否在主init .py 文件中添加了模型文件夹
推荐阅读
- c# - 在 SaveChangesAsync 之后返回实体是否危险?
- php - 在 PHP 7.2 版上读取加载会话数据失败
- c# - 如何修复“显示的主体(列表
)' 不能是迭代器块,因为 'string' 不是迭代器接口类型”? - android - 谁能建议如何在android Recycler View中实现按产品价格排序
- amazon-web-services - 允许 lambda 承担从身份池创建的 IAM 角色的角色?
- docker - 在 quay.io 中构建参数
- javascript - 如果用户选择日期,则 AJAX 发生错误
- python - 无法使用 folium add_child 创建点
- dart - 无法在颤振中运行我的第一个应用程序
- html - 如何从我的网页中删除 Bootstrap 缩略图