odoo 10 blog
-
这是报错的详细信息
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