-
-
-
-
-
-
-
-
-
-
Please fill in this field
-
+
-
-
+
+
+
+
+ New Event
+ event.event
+ form
+ new
+
+ {'default_address_id': False}
+
+
+
diff --git a/addons/website_forum/__manifest__.py b/addons/website_forum/__manifest__.py
index 676e7fe4da0..c079d80deb0 100644
--- a/addons/website_forum/__manifest__.py
+++ b/addons/website_forum/__manifest__.py
@@ -27,6 +27,7 @@ Ask questions, get answers, no distractions
'views/website_forum_profile.xml',
'views/ir_qweb.xml',
'views/snippets/snippets.xml',
+ 'views/forum_forum_add.xml',
'security/ir.model.access.csv',
'security/website_forum_security.xml',
'data/badges_question.xml',
@@ -42,7 +43,6 @@ Ask questions, get answers, no distractions
'assets': {
'website.assets_editor': [
'website_forum/static/src/js/tours/website_forum.js',
- 'website_forum/static/src/js/systray_items/new_content.js',
],
'web.assets_tests': [
'website_forum/static/tests/**/*',
@@ -53,7 +53,7 @@ Ask questions, get answers, no distractions
'website_forum/static/src/js/website_forum.share.js',
],
'web.assets_backend': [
- 'website_forum/static/src/js/systray_items/new_content.js',
+ 'website_forum/static/src/js/systray_items/*.js',
],
'web.assets_qweb': [
'website_forum/static/src/xml/*.xml',
diff --git a/addons/website_forum/static/src/js/systray_items/forum_forum_add_form.js b/addons/website_forum/static/src/js/systray_items/forum_forum_add_form.js
new file mode 100644
index 00000000000..b166ea16924
--- /dev/null
+++ b/addons/website_forum/static/src/js/systray_items/forum_forum_add_form.js
@@ -0,0 +1,27 @@
+/** @odoo-module **/
+
+import {NewContentFormController} from '@website/js/new_content_form';
+import viewRegistry from 'web.view_registry';
+import FormView from 'web.FormView';
+
+const AddForumFormController = NewContentFormController.extend({
+ /**
+ * @override
+ */
+ _getPath(state) {
+ return `/forum/${state.data.id}`;
+ },
+});
+
+const AddForumFormView = FormView.extend({
+ config: _.extend({}, FormView.prototype.config, {
+ Controller: AddForumFormController,
+ }),
+});
+
+viewRegistry.add('website_forum_add_form', AddForumFormView);
+
+export default {
+ AddForumFormController: AddForumFormController,
+ AddForumFormView: AddForumFormView,
+};
diff --git a/addons/website_forum/static/src/js/systray_items/new_content.js b/addons/website_forum/static/src/js/systray_items/new_content.js
index 532856fe8a8..ef1bf04dc71 100644
--- a/addons/website_forum/static/src/js/systray_items/new_content.js
+++ b/addons/website_forum/static/src/js/systray_items/new_content.js
@@ -12,5 +12,13 @@ patch(NewContentModal.prototype, 'website_forum_new_content', {
newForumElement.status = MODULE_STATUS.INSTALLED;
},
- createNewForum() {}
+ createNewForum() {
+ this.action.doAction('website_forum.forum_forum_action_add', {
+ onClose: (data) => {
+ if (data) {
+ this.website.goToWebsite({path: data.path});
+ }
+ },
+ });
+ }
});
diff --git a/addons/website_forum/views/forum_forum_add.xml b/addons/website_forum/views/forum_forum_add.xml
index aedc6223079..9d7798482ff 100644
--- a/addons/website_forum/views/forum_forum_add.xml
+++ b/addons/website_forum/views/forum_forum_add.xml
@@ -1,53 +1,27 @@
-
-
-
-
-
+
+
+
+
+ New Forum
+ forum.forum
+ form
+ new
+
+
+
+
diff --git a/addons/website_livechat/__manifest__.py b/addons/website_livechat/__manifest__.py
index dea83dfcf48..bd72bc35dbf 100644
--- a/addons/website_livechat/__manifest__.py
+++ b/addons/website_livechat/__manifest__.py
@@ -16,6 +16,7 @@ Allow website visitors to chat with the collaborators. This module also brings a
'views/im_livechat_chatbot_script_view.xml',
'views/website_livechat_view.xml',
'views/website_visitor_views.xml',
+ 'views/im_livechat_channel_add.xml',
'security/ir.model.access.csv',
'security/website_livechat.xml',
'data/website_livechat_data.xml',
@@ -42,6 +43,7 @@ Allow website visitors to chat with the collaborators. This module also brings a
'website_livechat/static/src/components/*/*.scss',
'website_livechat/static/src/models/*.js',
'website_livechat/static/src/js/systray_items/new_content.js',
+ 'website_livechat/static/src/js/systray_items/*.js',
],
'web.assets_tests': [
'website_livechat/static/tests/tours/**/*',
diff --git a/addons/website_livechat/static/src/js/systray_items/im_livechat_channel_add_form.js b/addons/website_livechat/static/src/js/systray_items/im_livechat_channel_add_form.js
new file mode 100644
index 00000000000..02cdfb7c9dc
--- /dev/null
+++ b/addons/website_livechat/static/src/js/systray_items/im_livechat_channel_add_form.js
@@ -0,0 +1,13 @@
+/** @odoo-module **/
+
+import {NewContentFormController} from '@website/js/new_content_form';
+import viewRegistry from 'web.view_registry';
+import FormView from 'web.FormView';
+
+export const AddChannelFormView = FormView.extend({
+ config: _.extend({}, FormView.prototype.config, {
+ Controller: NewContentFormController,
+ }),
+});
+
+viewRegistry.add('website_livechat_add_form', AddChannelFormView);
diff --git a/addons/website_livechat/static/src/js/systray_items/new_content.js b/addons/website_livechat/static/src/js/systray_items/new_content.js
index 46a2b933a97..e90f3364c48 100644
--- a/addons/website_livechat/static/src/js/systray_items/new_content.js
+++ b/addons/website_livechat/static/src/js/systray_items/new_content.js
@@ -12,5 +12,13 @@ patch(NewContentModal.prototype, 'website_livechat_new_content', {
newChannelElement.status = MODULE_STATUS.INSTALLED;
},
- createNewChannel() {}
+ createNewChannel() {
+ this.action.doAction('website_livechat.im_livechat_channel_action_add', {
+ onClose: (data) => {
+ if (data) {
+ this.website.goToWebsite({path: data.path});
+ }
+ },
+ });
+ }
});
diff --git a/addons/website_livechat/views/im_livechat_channel_add.xml b/addons/website_livechat/views/im_livechat_channel_add.xml
new file mode 100644
index 00000000000..da0e966600e
--- /dev/null
+++ b/addons/website_livechat/views/im_livechat_channel_add.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ im_livechat.channel.view.form.add
+ im_livechat.channel
+
+
+
+
+
+
+ New Channel
+ im_livechat.channel
+ form
+ new
+
+
+
+
diff --git a/addons/website_sale/__manifest__.py b/addons/website_sale/__manifest__.py
index fa0fa3fb868..b1851122509 100644
--- a/addons/website_sale/__manifest__.py
+++ b/addons/website_sale/__manifest__.py
@@ -29,7 +29,8 @@
'views/res_config_settings_views.xml',
'views/digest_views.xml',
'views/website_sale_visitor_views.xml',
- 'views/base_unit_view.xml'
+ 'views/base_unit_view.xml',
+ 'views/product_product_add.xml',
],
'demo': [
'data/demo.xml',
@@ -66,7 +67,7 @@
'website_sale/static/src/scss/website_sale_dashboard.scss',
'website_sale/static/src/scss/website_sale_backend.scss',
'website_sale/static/src/js/tours/website_sale_shop_backend.js',
- 'website_sale/static/src/js/systray_items/new_content.js',
+ 'website_sale/static/src/js/systray_items/*.js',
],
'website.assets_wysiwyg': [
'website_sale/static/src/scss/website_sale.editor.scss',
diff --git a/addons/website_sale/static/src/js/systray_items/new_content.js b/addons/website_sale/static/src/js/systray_items/new_content.js
index f4754321856..32dbdca28ff 100644
--- a/addons/website_sale/static/src/js/systray_items/new_content.js
+++ b/addons/website_sale/static/src/js/systray_items/new_content.js
@@ -2,39 +2,6 @@
import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content';
import { patch } from 'web.utils';
-import { WebsiteDialog } from '@website/components/dialog/dialog';
-
-const { xml, useState } = owl;
-
-export class AddProductDialog extends WebsiteDialog {
- setup() {
- super.setup();
-
- this.title = this.env._t("New Product");
- this.primaryTitle = this.env._t("Create");
-
- this.state = useState({
- name: '',
- });
- }
-
- async primaryClick() {
- await this.props.addProduct(this.state.name);
- this.close();
- }
-}
-AddProductDialog.bodyTemplate = xml`
-
-`;
patch(NewContentModal.prototype, 'website_sale_new_content', {
setup() {
@@ -46,12 +13,11 @@ patch(NewContentModal.prototype, 'website_sale_new_content', {
},
createNewProduct() {
- this.dialogs.add(AddProductDialog, {
- addProduct: async (name) => {
- const url = await this.rpc('/shop/add_product', {
- name,
- });
- this.website.goToWebsite({ path: url });
+ this.action.doAction('website_sale.product_product_action_add', {
+ onClose: (data) => {
+ if (data) {
+ this.website.goToWebsite({path: data.path, edition: true});
+ }
},
});
}
diff --git a/addons/website_sale/static/src/js/systray_items/product_product_add_form.js b/addons/website_sale/static/src/js/systray_items/product_product_add_form.js
new file mode 100644
index 00000000000..c90f6f01ad8
--- /dev/null
+++ b/addons/website_sale/static/src/js/systray_items/product_product_add_form.js
@@ -0,0 +1,27 @@
+/** @odoo-module **/
+
+import {NewContentFormController} from '@website/js/new_content_form';
+import viewRegistry from 'web.view_registry';
+import FormView from 'web.FormView';
+
+const AddProductFormController = NewContentFormController.extend({
+ /**
+ * @override
+ */
+ _getPath(state) {
+ return state.data.website_url.split('#')[0];
+ },
+});
+
+const AddProductFormView = FormView.extend({
+ config: _.extend({}, FormView.prototype.config, {
+ Controller: AddProductFormController,
+ }),
+});
+
+viewRegistry.add('product_product_add_form', AddProductFormView);
+
+export default {
+ AddProductFormController: AddProductFormController,
+ AddProductFormView: AddProductFormView,
+};
diff --git a/addons/website_sale/views/product_product_add.xml b/addons/website_sale/views/product_product_add.xml
new file mode 100644
index 00000000000..6c2cddea6f8
--- /dev/null
+++ b/addons/website_sale/views/product_product_add.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ product.product.view.form.add
+ product.product
+
+
+
+
+
+
+ New Product
+ product.product
+ form
+ new
+
+
+
+
diff --git a/addons/website_sale_slides/__manifest__.py b/addons/website_sale_slides/__manifest__.py
index 3ef082aca44..b3bd40e04d6 100644
--- a/addons/website_sale_slides/__manifest__.py
+++ b/addons/website_sale_slides/__manifest__.py
@@ -26,9 +26,6 @@
'web.assets_frontend': [
'website_sale_slides/static/src/js/**/*',
],
- 'web.assets_qweb': [
- 'website_sale_slides/static/src/xml/website_slides_channel.xml',
- ]
},
'license': 'LGPL-3',
}
diff --git a/addons/website_sale_slides/static/src/js/website_sale_slides_editor.js b/addons/website_sale_slides/static/src/js/website_sale_slides_editor.js
deleted file mode 100644
index cd206976c5d..00000000000
--- a/addons/website_sale_slides/static/src/js/website_sale_slides_editor.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/** @odoo-module **/
-
-import {ChannelCreateDialog} from '@website_slides/js/systray_items/new_content';
-
-ChannelCreateDialog.include({
- xmlDependencies: ChannelCreateDialog.prototype.xmlDependencies.concat(
- ['/website_sale_slides/static/src/xml/website_slides_channel.xml']
- ),
-
- events: _.extend({}, ChannelCreateDialog.prototype.events, {
- 'change input[name="enroll"]': '_onEnrollChanged',
- }),
-
- willStart: async function () {
- await this._super();
-
- this.products = await this._rpc({route: '/slides/get_course_products'});
- },
-
- /**
- * @private
- */
- _onEnrollChanged: function (ev) {
- this.$('.o_wslides_course_products').toggleClass('d-none', ev.target.value !== 'payment');
- },
-});
diff --git a/addons/website_sale_slides/static/src/xml/website_slides_channel.xml b/addons/website_sale_slides/static/src/xml/website_slides_channel.xml
deleted file mode 100644
index 1b03ebccf96..00000000000
--- a/addons/website_sale_slides/static/src/xml/website_slides_channel.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/website_sale_slides/views/slide_channel_views.xml b/addons/website_sale_slides/views/slide_channel_views.xml
index 4befb6d5a56..8724780df8e 100644
--- a/addons/website_sale_slides/views/slide_channel_views.xml
+++ b/addons/website_sale_slides/views/slide_channel_views.xml
@@ -49,4 +49,19 @@
+
+
+ slide.channel.view.form.add.inherit.sale.slides
+ slide.channel
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/website_slides/__manifest__.py b/addons/website_slides/__manifest__.py
index bfbf938b2ce..fd03d904421 100644
--- a/addons/website_slides/__manifest__.py
+++ b/addons/website_slides/__manifest__.py
@@ -47,6 +47,7 @@ Featuring
'views/website_slides_templates_lesson_embed.xml',
'views/website_slides_templates_profile.xml',
'views/website_slides_templates_utils.xml',
+ 'views/slide_channel_add.xml',
'wizard/slide_channel_invite_views.xml',
'data/gamification_data.xml',
'data/mail_data.xml',
@@ -70,7 +71,7 @@ Featuring
'website_slides/static/src/js/slide_category_one2many.js',
'website_slides/static/src/js/rating_field_backend.js',
'website_slides/static/src/models/*.js',
- 'website_slides/static/src/js/systray_items/new_content.js',
+ 'website_slides/static/src/js/systray_items/*.js',
],
'web.assets_frontend': [
'website_slides/static/src/scss/website_slides.scss',
@@ -100,9 +101,6 @@ Featuring
'web.assets_tests': [
'website_slides/static/tests/tours/*.js',
],
- 'website.assets_editor': [
- 'website_slides/static/src/js/systray_items/new_content.js',
- ],
'website_slides.slide_embed_assets': [
('include', 'web._assets_helpers'),
'web/static/lib/bootstrap/scss/_variables.scss',
diff --git a/addons/website_slides/static/src/js/systray_items/new_content.js b/addons/website_slides/static/src/js/systray_items/new_content.js
index c5ea11000bb..8b3159a0f3c 100644
--- a/addons/website_slides/static/src/js/systray_items/new_content.js
+++ b/addons/website_slides/static/src/js/systray_items/new_content.js
@@ -12,5 +12,13 @@ patch(NewContentModal.prototype, 'website_slides_new_content', {
newSlidesChannelElement.status = MODULE_STATUS.INSTALLED;
},
- createNewSlidesChannel() {}
+ createNewSlidesChannel() {
+ this.action.doAction('website_slides.slide_channel_action_add', {
+ onClose: (data) => {
+ if (data) {
+ this.website.goToWebsite({path: data.path});
+ }
+ },
+ });
+ }
});
diff --git a/addons/website_slides/static/src/js/systray_items/slide_channel_add_form.js b/addons/website_slides/static/src/js/systray_items/slide_channel_add_form.js
new file mode 100644
index 00000000000..be7600df403
--- /dev/null
+++ b/addons/website_slides/static/src/js/systray_items/slide_channel_add_form.js
@@ -0,0 +1,27 @@
+/** @odoo-module **/
+
+import {NewContentFormController} from '@website/js/new_content_form';
+import viewRegistry from 'web.view_registry';
+import FormView from 'web.FormView';
+
+const AddCourseFormController = NewContentFormController.extend({
+ /**
+ * @override
+ */
+ _getPath(state) {
+ return `/slides/${state.data.id}`;
+ },
+});
+
+const AddCourseFormView = FormView.extend({
+ config: _.extend({}, FormView.prototype.config, {
+ Controller: AddCourseFormController,
+ }),
+});
+
+viewRegistry.add('website_slides_add_form', AddCourseFormView);
+
+export default {
+ AddCourseFormController: AddCourseFormController,
+ AddCourseFormView: AddCourseFormView,
+};
diff --git a/addons/website_slides/views/slide_channel_add.xml b/addons/website_slides/views/slide_channel_add.xml
index 1589cbc30ac..ec9c06d3eba 100644
--- a/addons/website_slides/views/slide_channel_add.xml
+++ b/addons/website_slides/views/slide_channel_add.xml
@@ -1,49 +1,33 @@
-
+
+
-
+
+ slide.channel.view.form.add
+ slide.channel
+
+
+
+
-
-
-
-
-
+
+ New Course
+ slide.channel
+ form
+ new
+
+
-
+
diff --git a/addons/website_slides/views/website_slides_templates_utils.xml b/addons/website_slides/views/website_slides_templates_utils.xml
index f6078c70ddf..556413ca259 100644
--- a/addons/website_slides/views/website_slides_templates_utils.xml
+++ b/addons/website_slides/views/website_slides_templates_utils.xml
@@ -72,17 +72,6 @@
-
-