[FIX] website*: remove technical routes in sitemap

Multiple technical routes were listed in the sitemap,
and it's pointless to list them in the sitemap.

There is currently no way to exclude routes
from the sitemap using a specifc argument
(e.g. sitemap=False on the route).

Therefore, in order to remove them from the sitemap,
we play with the current conditions to exclude
these routes from the sitemap:
 - routes with `auth` other than `none` and  'public`
   are excluded. Technical routes marked as `auth="public"`
   for no reasons are changed to `auth="user" so they
   are excluded from the sitemap
 - routes with required arguments are excluded as well.
   the route `website/image` cannot work without any argument,
   `website/image` has therefore been removed from the possible
   routes for the method `website_image`, so it's no longer
   listed in the sitemap.

For an exhaustive list of the conditions to exclude
a route from the sitemap, check the method
`rule_is_enumerable` in `website/models/website.py`

opw-670865
This commit is contained in:
Denis Ledoux
2016-03-22 18:01:41 +01:00
parent 9d12f90c23
commit 6207644c00
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -433,7 +433,6 @@ class Website(openerp.addons.web.controllers.main.Home):
return request.registry['website']._image_placeholder(response)
@http.route([
'/website/image',
'/website/image/<xmlid>',
'/website/image/<xmlid>/<int:max_width>x<int:max_height>',
'/website/image/<xmlid>/<field>',
@@ -528,7 +527,7 @@ class Website(openerp.addons.web.controllers.main.Home):
#------------------------------------------------------
# Backend html field
#------------------------------------------------------
@http.route('/website/field/html', type='http', auth="public", website=True)
@http.route('/website/field/html', type='http', auth="user", website=True)
def FieldTextHtml(self, model=None, res_id=None, field=None, callback=None, **kwargs):
record = None
if model and res_id:
@@ -82,12 +82,12 @@ class Website(addons.website.controllers.main.Website):
#------------------------------------------------------
# Backend email template field
#------------------------------------------------------
@http.route('/website_mail/field/email', type='http', auth="public", website=True)
@http.route('/website_mail/field/email', type='http', auth="user", website=True)
def FieldTextHtmlEmail(self, model=None, res_id=None, field=None, callback=None, **kwargs):
kwargs['template'] = "website_mail.FieldTextHtmlEmail"
return self.FieldTextHtml(model, res_id, field, callback, **kwargs)
@http.route('/website_mail/field/email_template', type='http', auth="public", website=True)
@http.route('/website_mail/field/email_template', type='http', auth="user", website=True)
def FieldTextHtmlEmailTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs):
cr, uid, context = request.cr, request.uid, request.context
kwargs['theme'] = True