简体   繁体   English

AttributeError:“ NoneType”对象在Openerp中没有属性“ fields_get”

[英]AttributeError: 'NoneType' object has no attribute 'fields_get' in Openerp

why does this error occurs? 为什么会发生此错误? is anyone familiar with this error. 任何人都熟悉此错误。 i got this error when i click any of the tabs eg: sales,purchase,human resource,accounting etc. 当我单击任何选项卡时,例如:销售,购买,人力资源,会计等,我收到此错误。

Traceback (most recent call last):
File "/home/openERP/src/openerp-server/bin/osv/osv.py", line 122, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/openERP/src/openerp-server/bin/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/openERP/src/openerp-server/bin/osv/osv.py", line 167, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/openERP/src/openerp-server/bin/addons/hr/hr_department.py", line 94, in read
res = super(ir_action_window, self).read(cr, uid, select, fields=fields, context=context, load=load)
File "/home/openERP/src/openerp-server/bin/osv/orm.py", line 2944, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/openERP/src/openerp-server/bin/osv/orm.py", line 3064, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/home/openERP/src/openerp-server/bin/osv/fields.py", line 800, in get
res = self._fnct(obj, cr, user, ids, name, self._arg, context)
File "/home/openERP/src/openerp-server/bin/addons/base/ir/ir_actions.py", line 193, in _search_view
fields_from_fields_get = self.pool.get(act.res_model).fields_get(cr, uid, context=context)
AttributeError: 'NoneType' object has no attribute 'fields_get'

It looks like the problem in: 看起来像是问题所在:

self.pool.get(act.res_model)

It should be the name which you are using _name attributes 它应该是您使用_name属性的名称

Try with 试试看

self.pool.get(act.res.model)

self.pool.get(act.res_model) is returning None (because the dictionary pool doesn't have an entry with the key act.res_model ). self.pool.get(act.res_model)返回None (因为词典pool没有键为act.res_model的条目)。

Therefore, the call .fields_get(...) on that object fails (because None obviously doesn't have such a method, which is what the error message is trying to tell you). 因此,对该对象的.fields_get(...)调用失败(因为None显然没有这样的方法,这是错误消息试图告诉您的方法)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:'NoneType'对象没有属性'get' - Python - OpenErp - AttributeError: 'NoneType' object has no attribute 'get' - Python - OpenErp AttributeError: 'NoneType' object 没有属性 'get' helpp - AttributeError: 'NoneType' object has no attribute 'get' helpp 'NoneType' object 没有属性 'get':AttributeError - 'NoneType' object has no attribute 'get': AttributeError Flasgger AttributeError:'NoneType'对象没有属性'get'吗? - Flasgger AttributeError: 'NoneType' object has no attribute 'get'? “ AttributeError:'NoneType'对象没有属性'fields_view_get'”。 如何解决Odoo中的此错误? - “AttributeError: 'NoneType' object has no attribute 'fields_view_get'”. How to resolve this error in Odoo? AttributeError: 'NoneType' 对象没有属性 - AttributeError: 'NoneType' object has no attribute AttributeError:“ NoneType”对象没有属性“ a” - AttributeError: 'NoneType' object has no attribute 'a' openErp 6.1 AttributeError:“ NoneType”对象在自定义模块安装时没有属性“ _columns” - openErp 6.1 AttributeError: 'NoneType' object has no attribute '_columns' at custom module installation AttributeError: 'NoneType' object 没有属性 'get' - get.("href") - AttributeError: 'NoneType' object has no attribute 'get' - get.("href") 如何修复'AttributeError:'NoneType'对象在python中没有属性'get'错误 - How to fix 'AttributeError: 'NoneType' object has no attribute 'get' error in python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM