[FIX] website: do not suggest generic pages for existing specific ones
Before this commit, when obtaining link URL suggestions, both the specific and the matching generic page were suggested. After this commit, only the most specific ones are kept in the suggested list. This commit also adapts the sitemap in the same way. In stable, a condition on a dedicated context key is used in case those methods were called with the goal of obtaining both generic and specific pages. In 16.0, those methods will always filter duplicates pages as it was supposed at first. Steps to reproduce: - Edit Contact Us page (to create a specific view) - Edit the Contact Us menu - Type "/" in the URL => "/contactus" appeared twice. task-2968292 closes odoo/odoo#112746 X-original-commit: c5a50362ef55ced373c53c7af069fd5534043ae2 Signed-off-by: Romain Derie (rde) <rde@odoo.com> Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This commit is contained in:
@@ -1186,6 +1186,7 @@ class Website(models.Model):
|
||||
domain = []
|
||||
domain += self.get_current_website().website_domain()
|
||||
pages = self.env['website.page'].sudo().search(domain, order=order, limit=limit)
|
||||
pages = pages._get_most_specific_pages()
|
||||
return pages
|
||||
|
||||
def search_pages(self, needle=None, limit=None):
|
||||
|
||||
Reference in New Issue
Block a user