如何在OpenERP 7中创建many2one字段

时间:2012-12-05 18:31:31

标签: openerp

OpenERP 7没有这方面的文档:我正在尝试从webclient创建一个具有many2one关系的字段。我做了以下事情:

第一步创建了一个模型并为其分配了一些字段 第二个我创建了一个字段并从字段中映射模型,当我在视图中追加该字段时,我收到了此错误

  Client Traceback (most recent call last):
  File "/opt/openerp/web/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/openerp/web/addons/web/controllers/main.py", line 1085, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/opt/openerp/web/addons/web/controllers/main.py", line 1077, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/openerp/web/addons/web/session.py", line 40, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/openerp/web/addons/web/session.py", line 28, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/openerp/web/addons/web/session.py", line 101, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


Server Traceback (most recent call last):
  File "/opt/openerp/web/addons/web/session.py", line 87, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp/server/openerp/netsvc.py", line 361, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/server/openerp/service/web_services.py", line 601, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/server/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  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 2389, in name_search
    return self._name_search(cr, user, name, args, operator, context, limit)
  File "/opt/openerp/server/openerp/osv/orm.py", line 2420, in _name_search
    ids = self._search(cr, user, args, limit=limit, context=context, access_rights_uid=access_rights_uid)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4773, in _search
    query = self._where_calc(cr, user, args, context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4622, in _where_calc
    e = expression.expression(cr, user, domain, self, context)
  File "/opt/openerp/server/openerp/osv/expression.py", line 371, in __init__
    self.parse(cr, uid, distribute_not(normalize(exp)), table, context)
  File "/opt/openerp/server/openerp/osv/expression.py", line 468, in parse
    raise ValueError("Invalid field %r in domain expression %r" % (left, exp))
ValueError: Invalid field 'x_totalexp' in domain expression ['&', '&', ('x_totalexp', '=', 0), ['id', 'not in', []], ('name', 'ilike', 's')]

这是一个错误还是我做错了

1 个答案:

答案 0 :(得分:1)

现在正在工作。我也遇到了同样的问题,但在“bzr pull”之后,问题就解决了。

只需更新您的7.0插件,网络和放大器服务器