odoo开发笔记 -- 异常信息处理汇总

2018/05/10 11:12
阅读数 102

1

Traceback (most recent call last):
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/http.py", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/http.py", line 675, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/http.py", line 331, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/http.py", line 324, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/http.py", line 933, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/http.py", line 504, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odooshare/at_cloud_logistics/addons/web/controllers/main.py", line 885, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/addons/web/controllers/main.py", line 877, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/api.py", line 679, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/api.py", line 664, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/custom_addons/cus_center/models/work_sheet_extend.py", line 61, in create
    self.env['cus_center.customs_order'].create(dic)
  File "/home/odoo/odooshare/at_cloud_logistics/custom_addons/cus_center/models/customs_order.py", line 173, in create
    result = super(CustomsOrder, self).create(vals)
  File "/home/odoo/odooshare/at_cloud_logistics/addons/mail/models/mail_thread.py", line 228, in create
    thread = super(MailThread, self).create(values)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/models.py", line 3830, in create
    record = self.browse(self._create(old_vals))
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/models.py", line 3925, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/sql_db.py", line 141, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/odooshare/at_cloud_logistics/odoo/sql_db.py", line 218, in execute
    res = self._obj.execute(query, params)
ProgrammingError: can't adapt type 'cus_args.trade_terms'


没有加 多对一 .id 就会报上方的错误




异常处理2
TypeError: list indices must be integers, not tuple


检查你后台返回的数据格式,可能是字典,json,或者列表数据类型的数据中,少写了个逗号!!!!

 

2

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部