Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 缺少字段';的必需值时出现问题;对象';(model_id)当我更改权限文件ir.model.access.csv并升级模块时_Python_Module_Permissions_Upgrade_Odoo 12 - Fatal编程技术网

Python 缺少字段';的必需值时出现问题;对象';(model_id)当我更改权限文件ir.model.access.csv并升级模块时

Python 缺少字段';的必需值时出现问题;对象';(model_id)当我更改权限文件ir.model.access.csv并升级模块时,python,module,permissions,upgrade,odoo-12,Python,Module,Permissions,Upgrade,Odoo 12,我已经在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

我已经在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\u customer\security/ir.model.access.csv: 在字段“Object”中未找到外部id“model\u customer\u customer”的匹配记录 缺少字段“对象”(模型id)的必需值


请检查是否已在模型文件夹内的init.py中添加了文件名,还请检查是否已在主init.py文件中添加了模型文件夹。请尝试重新启动服务器,检查init文件是否添加了文件名,从manefest中注释csv文件,然后更新,然后再次取消注释并更新HI,检查您的文件“CustomerCustomer”是否已导入init.py文件是的,您是对的。非常感谢:)