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

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

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

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

odoo 10 blog



  • 求助大神 我装的是odoo10社区版,安官网的教程在线安装的。打开blog报unsupported operand type(s) for -: 'datetime.datetime' and 'datetime.date' Traceback


  • 管理员

    最好能给出完整的server log,你也可以在runbot里面测试下看看是不是有同样错误。



  • 这是报错的详细信息
    Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/odoo/addons/website/models/ir_http.py", line 264, in _handle_exception
    response = super(Http, cls)._handle_exception(exception)
    File "/usr/lib/python2.7/site-packages/odoo/addons/base/ir/ir_http.py", line 169, in _handle_exception
    return request._handle_exception(exception)
    File "/usr/lib/python2.7/site-packages/odoo/http.py", line 766, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
    File "/usr/lib/python2.7/site-packages/odoo/addons/base/ir/ir_http.py", line 195, in _dispatch
    result = request.dispatch()
    File "/usr/lib/python2.7/site-packages/odoo/http.py", line 825, in dispatch
    r = self._call_function(**self.params)
    File "/usr/lib/python2.7/site-packages/odoo/http.py", line 331, in call_function
    return checked_call(self.db, *args, **kwargs)
    File "/usr/lib/python2.7/site-packages/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
    File "/usr/lib/python2.7/site-packages/odoo/http.py", line 324, in checked_call
    result = self.endpoint(*a, **kw)
    File "/usr/lib/python2.7/site-packages/odoo/http.py", line 933, in call
    return self.method(*args, **kw)
    File "/usr/lib/python2.7/site-packages/odoo/http.py", line 504, in response_wrap
    response = f(*args, **kw)
    File "/usr/lib/python2.7/site-packages/odoo/addons/website_blog/controllers/main.py", line 168, in blog
    'nav_list': self.nav_list(blog),
    File "/usr/lib/python2.7/site-packages/odoo/addons/website_blog/controllers/main.py", line 43, in nav_list
    group['year'] = babel.dates.format_datetime(start, format='YYYY', tzinfo=tzinfo, locale=locale)
    File "/usr/lib/python2.7/site-packages/babel/dates.py", line 508, in format_datetime
    return parse_pattern(format).apply(datetime, locale)
    File "/usr/lib/python2.7/site-packages/babel/dates.py", line 702, in apply
    return self % DateTimeFormat(datetime, locale)
    File "/usr/lib/python2.7/site-packages/babel/dates.py", line 699, in mod
    return self.format % other
    File "/usr/lib/python2.7/site-packages/babel/dates.py", line 720, in getitem
    return self.format_year(char, num)
    File "/usr/lib/python2.7/site-packages/babel/dates.py", line 772, in format_year
    week = self.get_week_number(self.get_day_of_year())
    File "/usr/lib/python2.7/site-packages/babel/dates.py", line 863, in get_day_of_year
    return (date - date
    (date.year, 1, 1)).days + 1
    TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'datetime.date'



  • I solved on CentOS Linux release 7.3.1611 by upgrading babel.
    First I've upgraded pip and then babel:
    pip install --upgrade pip
    pip install --upgrade babel
    Restart odoo server and Blog app works!
    你升级一下babel。
    pip install --upgrade pip
    pip install --upgrade babel


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待