[IMP] website_event_*: 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.
Task ID: 2318597
closes odoo/odoo#56114
X-original-commit: aabd31d1523fb6ca68336cc66a6e2f074173f396
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
@@ -114,7 +114,7 @@ class WebsiteEventMeetController(EventCommunityController):
|
||||
# ROOM PAGE VIEW
|
||||
# ------------------------------------------------------------
|
||||
|
||||
@http.route("/event/<model('event.event'):event>/meeting_room/<model('event.meeting.room'):meeting_room>",
|
||||
@http.route('''/event/<model('event.event', "[('community_menu', '=', True)]"):event>/meeting_room/<model("event.meeting.room","[('event_id','=',event.id)]"):meeting_room>''',
|
||||
type="http", auth="public", website=True, sitemap=True)
|
||||
def event_meeting_room_page(self, event, meeting_room, **post):
|
||||
"""Display the meeting room frontend view.
|
||||
|
||||
@@ -108,7 +108,8 @@ class ExhibitorController(EventTrackController):
|
||||
# FRONTEND FORM
|
||||
# ------------------------------------------------------------
|
||||
|
||||
@http.route(['/event/<model("event.event"):event>/exhibitor/<model("event.sponsor"):sponsor>'], type='http', auth="public", website=True, sitemap=False)
|
||||
@http.route(['''/event/<model("event.event", "[('exhibitor_menu', '=', True)]"):event>/exhibitor/<model("event.sponsor", "[('event_id', '=', event.id)]"):sponsor>'''],
|
||||
type='http', auth="public", website=True, sitemap=True)
|
||||
def event_exhibitor(self, event, sponsor, **options):
|
||||
if not event.can_access_from_current_website():
|
||||
raise NotFound()
|
||||
|
||||
Reference in New Issue
Block a user