summaryrefslogtreecommitdiff
path: root/addons/website_event/controllers/main.py
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2019-10-22 07:19:44 +0000
committerJeremy Kersten <jke@odoo.com>2019-10-28 10:36:56 +0000
commite19227d3ba9c9296bfc0c221ac70a863a571b9a6 (patch)
tree47130e9859ecb4dd2c60bbf5dede855fd6428c5c /addons/website_event/controllers/main.py
parente2176749f6774196c76955319c753f28e849942d (diff)
[IMP] website*: clean sitemap
From now, you need to explicitely add sitemap=True if you want your controller into the sitemap. It's the default value, but if you forgot it, it will raise a Warning on runbot. It will avoid wrong controller in sitemap and duplicate (empty) content. From now, if your model contains a field website_id, the modelConverter for sitemap will automatically add the domain: "[('website_id', 'in', (False, current_website_id))]" It avoid redundant declaration and ugly url in redirect/rewrite view. Migration: need to remove it from url_from in website.rewrite task-2065018 closes odoo/odoo#39427 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/website_event/controllers/main.py')
-rw-r--r--addons/website_event/controllers/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py
index 20031a67781..d5348aa7a4a 100644
--- a/addons/website_event/controllers/main.py
+++ b/addons/website_event/controllers/main.py
@@ -156,7 +156,7 @@ class WebsiteEventController(http.Controller):
return request.render("website_event.index", values)
- @http.route(['''/event/<model("event.event", "[('website_id', 'in', (False, current_website_id))]"):event>/page/<path:page>'''], type='http', auth="public", website=True, sitemap=False)
+ @http.route(['''/event/<model("event.event"):event>/page/<path:page>'''], type='http', auth="public", website=True, sitemap=False)
def event_page(self, event, page, **post):
if not event.can_access_from_current_website():
raise werkzeug.exceptions.NotFound()
@@ -180,7 +180,7 @@ class WebsiteEventController(http.Controller):
return request.render(page, values)
- @http.route(['''/event/<model("event.event", "[('website_id', 'in', (False, current_website_id))]"):event>'''], type='http', auth="public", website=True)
+ @http.route(['''/event/<model("event.event"):event>'''], type='http', auth="public", website=True, sitemap=True)
def event(self, event, **post):
if not event.can_access_from_current_website():
raise werkzeug.exceptions.NotFound()
@@ -193,7 +193,7 @@ class WebsiteEventController(http.Controller):
target_url += '?enable_editor=1'
return request.redirect(target_url)
- @http.route(['''/event/<model("event.event", "[('website_id', 'in', (False, current_website_id))]"):event>/register'''], type='http', auth="public", website=True, sitemap=False)
+ @http.route(['''/event/<model("event.event"):event>/register'''], type='http', auth="public", website=True, sitemap=False)
def event_register(self, event, **post):
if not event.can_access_from_current_website():
raise werkzeug.exceptions.NotFound()
@@ -282,7 +282,7 @@ class WebsiteEventController(http.Controller):
registration[key] = value
return list(registrations.values())
- @http.route(['''/event/<model("event.event", "[('website_id', 'in', (False, current_website_id))]"):event>/registration/confirm'''], type='http', auth="public", methods=['POST'], website=True)
+ @http.route(['''/event/<model("event.event"):event>/registration/confirm'''], type='http', auth="public", methods=['POST'], website=True)
def registration_confirm(self, event, **post):
if not event.can_access_from_current_website():
raise werkzeug.exceptions.NotFound()