summaryrefslogtreecommitdiff
path: root/addons/website_rating/controllers/website_mail.py
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2017-08-09 13:09:32 +0200
committerJérome Maes <jem@openerp.com>2017-08-16 14:56:40 +0200
commit3cfd64f63f6153c170c9c876fa65976a95da22cb (patch)
treedcd477f6e8225ed788fa38484fc28272e77073bb /addons/website_rating/controllers/website_mail.py
parent2972976962617d4b8a0113bae58c640ab41cdff8 (diff)
[MOV] portal,website_mail: move chatter frontend to portal
This split responsiblilies : - portal provides basic chatter for portal document, and website documents (slides, blog, ...). - website_mail provides comments moderation (unpublished mail message) - website_rating integrate rating when posting comments
Diffstat (limited to 'addons/website_rating/controllers/website_mail.py')
-rw-r--r--addons/website_rating/controllers/website_mail.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/addons/website_rating/controllers/website_mail.py b/addons/website_rating/controllers/website_mail.py
index 4487307effd..26c0f4dedfa 100644
--- a/addons/website_rating/controllers/website_mail.py
+++ b/addons/website_rating/controllers/website_mail.py
@@ -1,19 +1,17 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from werkzeug.exceptions import NotFound
-
from odoo import http
from odoo.http import request
-from odoo.addons.website_mail.controllers.main import WebsiteMail
+from odoo.addons.portal.controllers.mail import PortalChatter
-class WebsiteRating(WebsiteMail):
+class WebsiteRating(PortalChatter):
@http.route()
- def website_chatter_init(self, res_model, res_id, domain=False, limit=False, **kwargs):
- result = super(WebsiteRating, self).website_chatter_init(res_model, res_id, domain=domain, limit=limit, **kwargs)
+ def portal_chatter_init(self, res_model, res_id, domain=False, limit=False, **kwargs):
+ result = super(WebsiteRating, self).portal_chatter_init(res_model, res_id, domain=domain, limit=limit, **kwargs)
# get the rating statistics about the record
if kwargs.get('rating_include'):
record = request.env[res_model].browse(res_id)
@@ -22,10 +20,10 @@ class WebsiteRating(WebsiteMail):
return result
@http.route()
- def website_message_fetch(self, res_model, res_id, domain=False, limit=False, offset=False, **kw):
- # add 'rating_include' in context, to fetch them in website_message_format
+ def portal_message_fetch(self, res_model, res_id, domain=False, limit=False, offset=False, **kw):
+ # add 'rating_include' in context, to fetch them in portal_message_format
if kw.get('rating_include'):
context = dict(request.context)
context['rating_include'] = True
request.context = context
- return super(WebsiteRating, self).website_message_fetch(res_model, res_id, domain=domain, limit=limit, offset=offset, **kw)
+ return super(WebsiteRating, self).portal_message_fetch(res_model, res_id, domain=domain, limit=limit, offset=offset, **kw)