diff --git a/addons/website/data/website_data.xml b/addons/website/data/website_data.xml
index ce4091a6352..a1a9c9d689b 100644
--- a/addons/website/data/website_data.xml
+++ b/addons/website/data/website_data.xml
@@ -143,12 +143,14 @@
diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py
index 6b390a52bf2..89458b4a5b6 100644
--- a/addons/website/models/ir_ui_view.py
+++ b/addons/website/models/ir_ui_view.py
@@ -189,10 +189,11 @@ class View(models.Model):
def _create_website_specific_pages_for_view(self, new_view, website):
for page in self.page_ids:
# create new pages for this view
- page.copy({
+ new_page = page.copy({
'view_id': new_view.id,
'is_published': page.is_published,
})
+ page.menu_ids.filtered(lambda m: m.website_id.id == website.id).page_id = new_page.id
@api.model
def get_related_views(self, key, bundles=False):
diff --git a/addons/website/static/src/js/menu/content.js b/addons/website/static/src/js/menu/content.js
index 866d046bf99..521e4bf8760 100644
--- a/addons/website/static/src/js/menu/content.js
+++ b/addons/website/static/src/js/menu/content.js
@@ -103,10 +103,10 @@ var PagePropertiesDialog = weWidgets.Dialog.extend({
this.$('.ask_for_redirect').addClass('d-none');
this.$('.redirect_type').addClass('d-none');
this.$('.warn_about_call').addClass('d-none');
- if (this.page.visibility != 'password') {
+ if (this.page.visibility !== 'password') {
this.$('.show_visibility_password').addClass('d-none');
}
- if (this.page.visibility != 'restricted_group') {
+ if (this.page.visibility !== 'restricted_group') {
this.$('.show_visibility_group').addClass('d-none');
}
this.autocompleteWithGroups(this.$('#visibility_group'));
@@ -353,8 +353,8 @@ var PagePropertiesDialog = weWidgets.Dialog.extend({
response(founds);
});
},
- change: (event, ui) => {
- var $target = $(event.target);
+ change: (ev, ui) => {
+ var $target = $(ev.target);
if (!ui.item) {
$target.val("");
$target.removeData('group-id');
@@ -396,7 +396,9 @@ var PagePropertiesDialog = weWidgets.Dialog.extend({
var createRedirect = this.$('input#create_redirect').prop('checked');
this.$('.redirect_type').toggleClass('d-none', !createRedirect);
},
-
+ /**
+ * @private
+ */
_onVisibilityChanged: function (ev) {
this.$('.show_visibility_password').toggleClass('d-none', ev.target.value !== 'password');
this.$('.show_visibility_group').toggleClass('d-none', ev.target.value !== 'restricted_group');
diff --git a/addons/website/static/src/js/show_password.js b/addons/website/static/src/js/show_password.js
index c9eb24df53c..a27d181208d 100644
--- a/addons/website/static/src/js/show_password.js
+++ b/addons/website/static/src/js/show_password.js
@@ -1,7 +1,8 @@
//
-// This file is meant to determine the timezone of a website visitor
-// If the visitor already exists, no need to keep the timezone cookie
-// as the timezone is set on the visitor.
+// This file is meant to allow to switch the type of an input #password
+// from password to text on mousedown on an input group.
+// On mouse down, we see the password in clear text
+// On mouse up, we hide it again.
//
odoo.define('website.show_password', function (require) {
'use strict';