From f57b92a8de4e3546df8b93655cea002b70d496da Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 13 Dec 2023 14:57:24 +0100 Subject: [PATCH] [FIX] website: remove duplicate action in page list view Before this commit and since commit [1], it was possible to clone a page in the page list view. It shouldn't be the case, cloning a page lead to bad result: a page with the same URL which is not shown in the page list view because pages are filtered by URL to remove duplicates. Cloning a page has always had to be done through the page properties > "clone page" button. Doing it this way will ask the user for a new page name (and so a new url). The page will then correctly be listed. [1]: https://github.com/odoo/odoo/commit/3192051806e0da1276604a31ad818f8768105362 opw-3591738 closes odoo/odoo#146173 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/components/views/page_list.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/website/static/src/components/views/page_list.js b/addons/website/static/src/components/views/page_list.js index edd56939a9e..6b24ed42743 100644 --- a/addons/website/static/src/components/views/page_list.js +++ b/addons/website/static/src/components/views/page_list.js @@ -56,6 +56,9 @@ export class PageListController extends PageControllerMixin(listView.Controller) callback: async () => this.togglePublished(false), }; } + if (this.props.resModel === "website.page") { + menuItems.duplicate.isAvailable = () => false; + } return menuItems; }