Odoo 12,尝试编辑 sale.order.line 时出现 CacheMiss 错误

Odoo 12, CacheMiss error when try to edit sale.order.line

提问人:Lucas 提问时间:11/2/2023 更新时间:11/2/2023 访问量:22

问:

假设我有两行产品,我删除其中一行,然后添加一条包含不同产品的新行,保存订单后系统返回以下错误。

Server application error
Error code: 200
Error message: Odoo Server Error
Error data message:
sale.order.line(103,).currency_id
None
Error data debug:
Traceback (most recent call last):
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/api.py", line 1050, in get
value = self.\_data\[key\]\[field\]\[record.\_ids\[0\]\]
KeyError: 103

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 663, in \_handle_exception
return super(JsonRequest, self).\_handle_exception(exception)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 321, in \_handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()\[2\])
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 705, in dispatch
result = self.\_call_function(\*\*self.params)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 353, in \_call_function
return checked_call(self.db, \*args, \*\*kwargs)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/service/model.py", line 98, in wrapper
return f(dbname, \*args, \*\*kwargs)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 346, in checked_call
result = self.endpoint(\*a, \*\*kw)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 948, in __call__
return self.method(\*args, \*\*kw)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/http.py", line 526, in response_wrap
response = f(\*args, \*\*kw)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/addons/web/controllers/main.py", line 959, in call_kw
return self.\_call_kw(model, method, args, kwargs)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/addons/web/controllers/main.py", line 951, in \_call_kw
return call_kw(request.env\[model\], method, args, kwargs)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/api.py", line 760, in call_kw
return \_call_kw_multi(method, model, args, kwargs)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/api.py", line 747, in \_call_kw_multi
result = method(recs, \*args, \*\*kwargs)
File "/home/lucas/Documents/work/odoo/voraz/addons/addons/vz_sale/models/sale.py", line 482, in write
rec = super(SaleOrder, self).write(vals)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/addons/mail/models/mail_thread.py", line 320, in write
result = super(MailThread, self).write(values)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/addons/mail/models/mail_activity.py", line 621, in write
return super(MailActivityMixin, self).write(vals)
File "/home/lucas/Documents/work/odoo/voraz/addons/addons/ks_dashboard_ninja/models/ks_odoo_base.py", line 25, in write
recs = super(Base, self).write(vals)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/models.py", line 3403, in write
self.recompute()
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/models.py", line 5325, in recompute
vals = {n: rec\[n\] for n in ns}
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/models.py", line 5325, in \<dictcompvals = {n: rec\[n\] for n in ns}
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/models.py", line 5171, in __getitem__
return self.\_fields\[key\].__get__(self, type(self))
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/fields.py", line 1071, in __get__
value = record.env.cache.get(record, self)
File "/home/lucas/Documents/work/odoo/odoo12/odoo/odoo/api.py", line 1052, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('sale.order.line(103,).currency_id', None)

保存订单后

老实说,我不知道是什么导致系统以这种方式行事。我已经尝试在继承的模型中重新创建货币 ID 字段,但仍然不起作用。 我需要了解导致这种情况的原因,并需要一个解决方案。

python postgresql odoo-12

评论


答: 暂无答案