0

为什么会出现这个错误?有谁熟悉这个错误。当我单击任何选项卡时出现此错误,例如:销售、采购、人力资源、会计等。

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'
4

2 回答 2

3

It looks like the problem in:

self.pool.get(act.res_model)

It should be the name which you are using _name attributes

Try with

self.pool.get(act.res.model)
于 2012-05-11T09:52:44.323 回答
2

self.pool.get(act.res_model)正在返回None(因为字典pool没有带有 key 的条目act.res_model)。

因此,.fields_get(...)对该对象的调用失败(因为None显然没有这样的方法,这是错误消息试图告诉你的)。

于 2012-05-11T07:43:49.363 回答