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

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

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

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

[已解决]odoo8 mass editing 时message_post报错



  • 代码:

                if context is None:
                    context = {}
                if not context.get('no_track_all') and not isinstance(context, frozendict):
                    message = convert_for_display(self, cr, uid, ids, values, level, context=context)
                 if message:
                     self.message_post(cr, uid, ids, subject=None, body=message,          subtype=subtype, type='comment', context={'no_track_all': True})
    

    下面这句的错误怎么解决?(写上默认的thread_id=[0]没作用啊)
    AssertionError: Invalid thread_id; should be 0, False, an ID or a list with one ID

    报错信息如下:

    2017-12-26 08:18:24,720 23929 ERROR 1221_v8 openerp.http: Exception during JSON request handling.
    Traceback (most recent call last):
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/http.py", line 543, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/http.py", line 580, in dispatch
        result = self._call_function(**self.params)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/http.py", line 316, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/service/model.py", line 118, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/http.py", line 313, in checked_call
        return self.endpoint(*a, **kw)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/http.py", line 809, in __call__
        return self.method(*args, **kw)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/http.py", line 409, in response_wrap
        response = f(*args, **kw)
      File "/home/odoo/odoo-dev/odoo8/odoo8/addons/web/controllers/main.py", line 944, in call_kw
        return self._call_kw(model, method, args, kwargs)
      File "/home/odoo/odoo-dev/odoo8/odoo8/addons/web/controllers/main.py", line 936, in _call_kw
        return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/api.py", line 268, in wrapper
        return old_api(self, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo8/3rdaddons/mass_editing/wizard/mass_editing_wizard.py", line 208, in create
        cr, uid, context.get('active_ids'), dict, context)
      File "/home/odoo/odoo-dev/odoo8/exide/exide_application/exide_application.py", line 57, in wrapper
        return func(*args, **kwargs)
      File "/home/odoo/odoo-dev/odoo8/exide/exide_application/exide_application.py", line 189, in warpper
        context=context)
      File "/home/odoo/odoo-dev/odoo8/odoo8/openerp/api.py", line 268, in wrapper
        return old_api(self, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo8/odoo8/addons/mail/mail_thread.py", line 1623, in message_post
        "Invalid thread_id; should be 0, False, an ID or a list with one ID"
    AssertionError: Invalid thread_id; should be 0, False, an ID or a list with one ID
    


  • @1234567
    已解决。
    odoo8要求message_postthread_id只能是一个的。这里的ids就是thread_ids的值,位置参数。
    如果要发送多条消息,循环ids。


登录后回复