Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

o2m 其中一条记录选择父级报错



  • 在执行报存操作的时候,偶尔会报这个错。只有在one2many字段中给某条记录选择父级的时候有这个错。有能解读下报错原因的吗?非常感谢。

    Traceback (most recent call last):
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/fields.py", line 944, in __get__
        value = record.env.cache.get(record, self)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 967, in get
        value = self._data[key][field][record._ids[0]]
    KeyError: 16
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 651, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 310, in _handle_exception
        raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/tools/pycompat.py", line 87, in reraise
        raise value
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 693, in dispatch
        result = self._call_function(**self.params)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 342, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/service/model.py", line 97, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 335, in checked_call
        result = self.endpoint(*a, **kw)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 937, in __call__
        return self.method(*args, **kw)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 515, in response_wrap
        response = f(*args, **kw)
      File "/home/hui/odoo-dev/odoo11/odoo11/addons/web/controllers/main.py", line 934, in call_kw
        return self._call_kw(model, method, args, kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/addons/web/controllers/main.py", line 926, in _call_kw
        return call_kw(request.env[model], method, args, kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 687, in call_kw
        return call_kw_model(method, model, args, kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 672, in call_kw_model
        result = method(recs, *args, **kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/addons/mail/models/mail_thread.py", line 238, in create
        thread = super(MailThread, self).create(values)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 3393, in create
        record = self.browse(self._create(old_vals))
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 3550, in _create
        self.recompute()
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 4930, in recompute
        vals = {n: rec[n] for n in ns}
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 4930, in <dictcomp>
        vals = {n: rec[n] for n in ns}
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 4784, in __getitem__
        return self._fields[key].__get__(self, type(self))
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/fields.py", line 951, in __get__
        value = record.env.cache.get(record, self)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 967, in get
        value = self._data[key][field][record._ids[0]]
    KeyError: 16
    


  • 2019-07-17 02:25:15,920 5812 ERROR 0703_v11 odoo.http: Exception during JSON request handling.
    Traceback (most recent call last):
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/fields.py", line 944, in __get__
        value = record.env.cache.get(record, self)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 967, in get
        value = self._data[key][field][record._ids[0]]
    KeyError: <odoo.models.NewId object at 0x7f2984a3b6a8>
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 651, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 310, in _handle_exception
        raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/tools/pycompat.py", line 87, in reraise
        raise value
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 693, in dispatch
        result = self._call_function(**self.params)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 342, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/service/model.py", line 97, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 335, in checked_call
        result = self.endpoint(*a, **kw)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 937, in __call__
        return self.method(*args, **kw)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/http.py", line 515, in response_wrap
        response = f(*args, **kw)
      File "/home/hui/odoo-dev/odoo11/odoo11/addons/web/controllers/main.py", line 934, in call_kw
        return self._call_kw(model, method, args, kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/addons/web/controllers/main.py", line 926, in _call_kw
        return call_kw(request.env[model], method, args, kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 689, in call_kw
        return call_kw_multi(method, model, args, kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 680, in call_kw_multi
        result = method(recs, *args, **kwargs)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 5197, in onchange
        snapshot1 = Snapshot(record, nametree)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 5104, in __init__
        if subnames else record[name]
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/models.py", line 4784, in __getitem__
        return self._fields[key].__get__(self, type(self))
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/fields.py", line 951, in __get__
        value = record.env.cache.get(record, self)
      File "/home/hui/odoo-dev/odoo11/odoo11/odoo/api.py", line 967, in get
        value = self._data[key][field][record._ids[0]]
    KeyError: <odoo.models.NewId object at 0x7f2984a3b6a8>
    

Log in to reply