[英]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.