diff --git a/addons/portal_rating/controllers/portal_rating.py b/addons/portal_rating/controllers/portal_rating.py index 06d1fe06ac1..2e8e4884730 100644 --- a/addons/portal_rating/controllers/portal_rating.py +++ b/addons/portal_rating/controllers/portal_rating.py @@ -7,7 +7,7 @@ from odoo.http import request class PortalRating(http.Controller): - @http.route(['/website/rating/comment'], type='json', auth="user", method=['POST'], website=True) + @http.route(['/website/rating/comment'], type='json', auth="user", methods=['POST'], website=True) def publish_rating_comment(self, rating_id, publisher_comment): rating = request.env['rating.rating'].search([('id', '=', int(rating_id))]) if not rating: diff --git a/odoo/http.py b/odoo/http.py index 2262afc6bb5..0676f3a7ff2 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -514,6 +514,10 @@ def route(route=None, **kw): else: routes = [route] routing['routes'] = routes + wrong = routing.pop('method', None) + if wrong: + kw.setdefault('methods', wrong) + _logger.warning(" defined with invalid routing parameter 'method', assuming 'methods'", f.__module__, f.__name__) @functools.wraps(f) def response_wrap(*args, **kw):