1

试用使用 jquery mobile 构建的 openERP 6.1 内置移动应用程序。
我有自己的模块“school.student”,当我点击学生时,我看到学生树,当我点击任何特定学生时,我得到错误

File "/opt/openerp/server/openerp/osv/fields.py", line 551, in get
    ids2 = obj.pool.get(self._obj).search(cr, user, 
                           self._domain + [(self._fields_id, 'in', ids)], 
                           limit=self._limit, context=context)

AttributeError: 'NoneType' object has no attribute 'search' 好像它没有获取这里有问题的对象是school.student

通过 web 或 gtk 客户端没有类似的错误,只有新的移动客户端。
访问任何其他对象(例如 school.course 甚至school.course.subjects. 只是那个不打开的 school.student 表单视图。关于为什么会发生这种情况的任何想法?

编辑:追溯

2012-09-07 13:57:47,199 17516 INFO ? werkzeug: 192.168.100.106 - - [07/Sep/2012 13:57:47] "GET /favicon.ico HTTP/1.1" 404 -
> /opt/openerp/server/openerp/osv/fields.py(554)get()
-> for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
(Pdb) ids2
[]
(Pdb) c
> /opt/openerp/server/openerp/osv/fields.py(554)get()
-> for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
(Pdb) ids2
[]
(Pdb) c
> /opt/openerp/server/openerp/osv/fields.py(554)get()
-> for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
(Pdb) ids2
[]
(Pdb) c
2012-09-07 13:58:03,198 17516 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
File "/opt/openerp/server/openerp/osv/osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/openerp/server/openerp/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp/server/openerp/osv/osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp/server/openerp/osv/orm.py", line 3381, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/opt/openerp/server/openerp/osv/orm.py", line 3504, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/opt/openerp/server/openerp/osv/fields.py", line 552, in get
ids2 = obj.pool.get(self._obj).search(cr, user, self._domain + [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
AttributeError: 'NoneType' object has no attribute 'search'
2012-09-07 13:58:03,202 17516 ERROR ? openerp.netsvc: 'NoneType' object has no attribute 'search'
2012-09-07 13:58:03,208 17516 INFO ? werkzeug: 192.168.100.106 - - [07/Sep/2012 13:58:03] "POST /web/dataset/search_read HTTP/1.1" 200 -

4

1 回答 1

3

问题是self._obj返回不存在的值,pool因此当您尝试pool使用该方法从该对象获取对象时,get它会尝试从该方法中找到键,dict但由于该键不存在,pool因此返回None.

如果这不会在 GTK 或 WEB 中出现错误,请尝试self._obj在所有客户端中显示。

于 2012-09-05T08:59:48.753 回答