[FIX] website: allow publishers to save their website edition
On save, the editor will ask to parent widgets if something needs to be done first. The website navbar will receive that demand and asks to its action-capable components to do something. For example, the content menu handles page-related options saving. However, some users with limited access rights do not have the content menu... but the website navbar expects that the save action is performed. So, this empty action is defined here so that all users have an 'on_save' related action. This was only happening since 12.0 as 'on_save' actions were introduced there to save page-related options. closes odoo/odoo#28810
This commit is contained in:
@@ -15,6 +15,7 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
|
||||
xmlDependencies: ['/website/static/src/xml/website.editor.xml'],
|
||||
actions: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.prototype.actions, {
|
||||
edit: '_startEditMode',
|
||||
on_save: '_onSave',
|
||||
}),
|
||||
custom_events: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.custom_events || {}, {
|
||||
snippet_dropped: '_onSnippetDropped',
|
||||
@@ -89,6 +90,19 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
|
||||
return def;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* On save, the editor will ask to parent widgets if something needs to be
|
||||
* done first. The website navbar will receive that demand and asks to its
|
||||
* action-capable components to do something. For example, the content menu
|
||||
* handles page-related options saving. However, some users with limited
|
||||
* access rights do not have the content menu... but the website navbar
|
||||
* expects that the save action is performed. So, this empty action is
|
||||
* defined here so that all users have an 'on_save' related action.
|
||||
*
|
||||
* @private
|
||||
* @todo improve the system to somehow declare required/optional actions
|
||||
*/
|
||||
_onSave: function () {},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Handlers
|
||||
|
||||
Reference in New Issue
Block a user