diff --git a/addons/account/static/src/js/tours/account.js b/addons/account/static/src/js/tours/account.js index e854f1c3bd0..8410249f275 100644 --- a/addons/account/static/src/js/tours/account.js +++ b/addons/account/static/src/js/tours/account.js @@ -2,6 +2,7 @@ odoo.define('account.tour', function(require) { "use strict"; var core = require('web.core'); +const {Markup} = require('web.utils'); var tour = require('web_tour.tour'); var _t = core._t; @@ -36,7 +37,7 @@ tour.register('account_tour', { }, { trigger: "div[name=partner_id] input", extra_trigger: "[name=move_type][raw-value=out_invoice]", - content: _t("Write a company name to create one or see suggestions."), + content: Markup(_t("Write a company name to create one or see suggestions.")), position: "bottom", }, { trigger: ".o_m2o_dropdown_option a:contains('Create')", @@ -46,7 +47,7 @@ tour.register('account_tour', { }, { trigger: ".modal-content button.btn-primary", extra_trigger: "[name=move_type][raw-value=out_invoice]", - content: _t("Once everything is set, you are good to continue. You will be able to edit this later in the Customers menu."), + content: Markup(_t("Once everything is set, you are good to continue. You will be able to edit this later in the Customers menu.")), auto: true, }, { trigger: "div[name=invoice_line_ids] .o_field_x2many_list_row_add a:not([data-context])", @@ -74,7 +75,7 @@ tour.register('account_tour', { }, { trigger: "input[name=email]", extra_trigger: "[name=move_type][raw-value=out_invoice]", - content: _t("Write here your own email address to test the flow."), + content: Markup(_t("Write here your own email address to test the flow.")), run: 'text customer@example.com', auto: true, }, { diff --git a/addons/account/views/account_payment_term_views.xml b/addons/account/views/account_payment_term_views.xml index f8958bc57f5..e88df582e41 100644 --- a/addons/account/views/account_payment_term_views.xml +++ b/addons/account/views/account_payment_term_views.xml @@ -118,7 +118,7 @@
-
+
diff --git a/addons/calendar/__manifest__.py b/addons/calendar/__manifest__.py index f44f1abeca5..a10644bcdca 100644 --- a/addons/calendar/__manifest__.py +++ b/addons/calendar/__manifest__.py @@ -45,7 +45,6 @@ If you need to manage your meetings, you should install the CRM module. 'calendar/static/src/js/calendar_controller.js', 'calendar/static/src/js/calendar_model.js', 'calendar/static/src/js/calendar_view.js', - 'calendar/static/src/js/mail_activity.js', 'calendar/static/src/js/systray_activity_menu.js', 'calendar/static/src/js/services/calendar_notification_service.js', ], diff --git a/addons/calendar/static/src/js/mail_activity.js b/addons/calendar/static/src/js/mail_activity.js deleted file mode 100644 index b25cc663204..00000000000 --- a/addons/calendar/static/src/js/mail_activity.js +++ /dev/null @@ -1,60 +0,0 @@ -odoo.define('calendar.Activity', function (require) { -"use strict"; - -var Activity = require('@mail/js/activity')[Symbol.for("default")]; -var Dialog = require('web.Dialog'); -var core = require('web.core'); -var _t = core._t; - -Activity.include({ - - /** - * Override behavior to redirect to calendar event instead of activity - * - * @override - */ - _onEditActivity: function (event, options) { - var self = this; - var activity_id = $(event.currentTarget).data('activity-id'); - var activity = _.find(this.activities, function (act) { return act.id === activity_id; }); - if (activity && activity.activity_category === 'meeting' && activity.calendar_event_id) { - return self._super(event, _.extend({ - res_model: 'calendar.event', - res_id: activity.calendar_event_id[0], - })); - } - return self._super(event, options); - }, - - /** - * Override behavior to warn that the calendar event is about to be removed as well - * - * @override - */ - _onUnlinkActivity: function (event, options) { - event.preventDefault(); - var self = this; - var activity_id = $(event.currentTarget).data('activity-id'); - var activity = _.find(this.activities, function (act) { return act.id === activity_id; }); - if (activity && activity.activity_category === 'meeting' && activity.calendar_event_id) { - Dialog.confirm( - self, - _t("The activity is linked to a meeting. Deleting it will remove the meeting as well. Do you want to proceed ?"), { - confirm_callback: function () { - return self._rpc({ - model: 'mail.activity', - method: 'unlink_w_meeting', - args: [[activity_id]], - }) - .then(self._reload.bind(self, {activity: true})); - }, - } - ); - } - else { - return self._super(event, options); - } - }, -}); - -}); diff --git a/addons/crm/static/src/js/tours/crm.js b/addons/crm/static/src/js/tours/crm.js index 8c2e13506fb..12893ba0f15 100644 --- a/addons/crm/static/src/js/tours/crm.js +++ b/addons/crm/static/src/js/tours/crm.js @@ -2,6 +2,7 @@ odoo.define('crm.tour', function(require) { "use strict"; var core = require('web.core'); +const {Markup} = require('web.utils'); var tour = require('web_tour.tour'); var _t = core._t; @@ -12,22 +13,22 @@ tour.register('crm_tour', { sequence: 10, }, [tour.stepUtils.showAppsMenuItem(), { trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]', - content: _t('Ready to boost your sales? Let\'s have a look at your Pipeline.'), + content: Markup(_t('Ready to boost your sales? Let\'s have a look at your Pipeline.')), position: 'bottom', edition: 'community', }, { trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]', - content: _t('Ready to boost your sales? Let\'s have a look at your Pipeline.'), + content: Markup(_t('Ready to boost your sales? Let\'s have a look at your Pipeline.')), position: 'bottom', edition: 'enterprise', }, { trigger: '.o-kanban-button-new', extra_trigger: '.o_opportunity_kanban', - content: _t("Create your first opportunity."), + content: Markup(_t("Create your first opportunity.")), position: 'bottom', }, { trigger: ".o_kanban_quick_create .o_field_widget[name='partner_id']", - content: _t('Write a few letters to look for a company, or create a new one.'), + content: Markup(_t('Write a few letters to look for a company, or create a new one.')), position: "top", run: function (actions) { actions.text("Brandon Freeman", this.$anchor.find("input")); @@ -38,28 +39,28 @@ tour.register('crm_tour', { in_modal: false, }, { trigger: ".o_kanban_quick_create .o_kanban_add", - content: _t("Now, add your Opportunity to your Pipeline."), + content: Markup(_t("Now, add your Opportunity to your Pipeline.")), position: "bottom", }, { trigger: ".o_opportunity_kanban .o_kanban_group:first-child .o_kanban_record:last-child .oe_kanban_content", extra_trigger: ".o_opportunity_kanban", - content: _t("Drag & drop opportunities between columns as you progress in your sales cycle."), + content: Markup(_t("Drag & drop opportunities between columns as you progress in your sales cycle.")), position: "right", run: "drag_and_drop .o_opportunity_kanban .o_kanban_group:eq(2) ", }, { trigger: ".o_kanban_record:not(.o_updating) .o_activity_color_default", extra_trigger: ".o_opportunity_kanban", - content: _t("Looks like nothing is planned. :(

Tip : Schedule activities to keep track of everything you have to do!"), + content: Markup(_t("Looks like nothing is planned. :(

Tip : Schedule activities to keep track of everything you have to do!")), position: "bottom", }, { trigger: ".o_schedule_activity", extra_trigger: ".o_opportunity_kanban", - content: _t("Let's Schedule an Activity."), + content: Markup(_t("Let's Schedule an Activity.")), position: "bottom", width: 200, }, { trigger: '.modal-footer button[name="action_close_dialog"]', - content: _t("All set. Let’s Schedule it."), + content: Markup(_t("All set. Let’s Schedule it.")), position: "top", // dot NOT move to bottom, it would cause a resize flicker, see task-2476595 run: function (actions) { actions.auto('.modal-footer button[special=cancel]'); @@ -67,7 +68,7 @@ tour.register('crm_tour', { }, { id: "drag_opportunity_to_won_step", trigger: ".o_opportunity_kanban .o_kanban_record:last-child", - content: _t("Drag your opportunity to Won when you get the deal. Congrats !"), + content: Markup(_t("Drag your opportunity to Won when you get the deal. Congrats !")), position: "bottom", run: "drag_and_drop .o_opportunity_kanban .o_kanban_group:eq(3) ", }, { diff --git a/addons/crm_iap_lead/static/src/js/tours/crm_iap_lead.js b/addons/crm_iap_lead/static/src/js/tours/crm_iap_lead.js index 577b6cd14d9..8d9b913645b 100644 --- a/addons/crm_iap_lead/static/src/js/tours/crm_iap_lead.js +++ b/addons/crm_iap_lead/static/src/js/tours/crm_iap_lead.js @@ -2,6 +2,7 @@ odoo.define('crm_iap_lead.generate_leads_steps', function (require) { "use strict"; var tour = require('web_tour.tour'); +const {Markup} = require('web.utils'); var core = require('web.core'); require('crm.tour'); @@ -20,7 +21,7 @@ tour.tours.crm_tour.steps.splice(DragOppToWonStepIndex + 1, 0, { * */ trigger: ".o_button_generate_leads", - content: _t("Looking for more opportunities ?
Try the Lead Generation tool."), + content: Markup(_t("Looking for more opportunities ?
Try the Lead Generation tool.")), position: "bottom", run: function (actions) { actions.auto('.o_button_generate_leads'); @@ -38,4 +39,4 @@ tour.tours.crm_tour.steps.splice(DragOppToWonStepIndex + 1, 0, { } }); -}); \ No newline at end of file +}); diff --git a/addons/event/static/src/js/tours/event_tour.js b/addons/event/static/src/js/tours/event_tour.js index d336729357e..88caff125db 100644 --- a/addons/event/static/src/js/tours/event_tour.js +++ b/addons/event/static/src/js/tours/event_tour.js @@ -18,8 +18,8 @@ return EventAdditionalTourSteps; odoo.define('event.event_tour', function (require) { "use strict"; -var core = require('web.core'); -var _t = core._t; +const {_t} = require('web.core'); +const {Markup} = require('web.utils'); var tour = require('web_tour.tour'); var EventAdditionalTourSteps = require('event.event_steps'); @@ -30,33 +30,33 @@ tour.register('event_tour', { sequence: 210, }, [tour.stepUtils.showAppsMenuItem(), { trigger: '.o_app[data-menu-xmlid="event.event_main_menu"]', - content: _t("Ready to organize events in a few minutes? Let's get started!"), + content: Markup(_t("Ready to organize events in a few minutes? Let's get started!")), position: 'bottom', edition: 'enterprise', }, { trigger: '.o_app[data-menu-xmlid="event.event_main_menu"]', - content: _t("Ready to organize events in a few minutes? Let's get started!"), + content: Markup(_t("Ready to organize events in a few minutes? Let's get started!")), edition: 'community', }, { trigger: '.o-kanban-button-new', extra_trigger: '.o_event_kanban_view', - content: _t("Let's create your first event."), + content: Markup(_t("Let's create your first event.")), position: 'bottom', width: 175, }, { trigger: '.o_event_form_view input[name="name"]', - content: _t("This is the name your guests will see when registering."), + content: Markup(_t("This is the name your guests will see when registering.")), run: 'text Odoo Experience 2020', }, { trigger: '.o_event_form_view input[name="date_end"]', - content: _t("When will your event take place? Select the start and end dates and click Apply."), + content: Markup(_t("When will your event take place? Select the start and end dates and click Apply.")), run: function () { $('input[name="date_begin"]').val('09/30/2020 08:00:00').change(); $('input[name="date_end"]').val('10/02/2020 23:00:00').change(); }, }, { trigger: '.o_event_form_view div[name="event_ticket_ids"] .o_field_x2many_list_row_add a', - content: _t("Ticket types allow you to distinguish your attendees. Let's create a new one."), + content: Markup(_t("Ticket types allow you to distinguish your attendees. Let's create a new one.")), }, ...new EventAdditionalTourSteps()._get_website_event_steps(), { trigger: '.o_event_form_view div[name="stage_id"]', extra_trigger: 'div.o_form_buttons_view:not(.o_hidden)', @@ -65,7 +65,7 @@ tour.register('event_tour', { }, { trigger: 'ol.breadcrumb li.breadcrumb-item:first', extra_trigger: '.o_event_form_view div[name="stage_id"]', - content: _t("Use the breadcrumbs to go back to your kanban overview."), + content: Markup(_t("Use the breadcrumbs to go back to your kanban overview.")), position: 'bottom', run: 'click', }].filter(Boolean)); diff --git a/addons/gamification/views/badge.xml b/addons/gamification/views/badge.xml index f59c5985d2a..539e5254a7e 100644 --- a/addons/gamification/views/badge.xml +++ b/addons/gamification/views/badge.xml @@ -145,7 +145,7 @@ this month
- +
Owner diff --git a/addons/hr_expense/static/src/js/tours/hr_expense.js b/addons/hr_expense/static/src/js/tours/hr_expense.js index 66662f601b2..b8200677c51 100644 --- a/addons/hr_expense/static/src/js/tours/hr_expense.js +++ b/addons/hr_expense/static/src/js/tours/hr_expense.js @@ -1,11 +1,10 @@ odoo.define('hr_expense.tour', function(require) { "use strict"; -var core = require('web.core'); +const {_t} = require('web.core'); +const {Markup} = require('web.utils'); var tour = require('web_tour.tour'); -var _t = core._t; - tour.register('hr_expense_tour' , { url: "/web" }, [tour.stepUtils.showAppsMenuItem(), { @@ -20,7 +19,7 @@ tour.register('hr_expense_tour' , { edition: 'enterprise' }, { trigger: '.o_form_button_save', - content: _t("

Once your Expense is ready, you can save it.

"), + content: Markup(_t("

Once your Expense is ready, you can save it.

")), position: 'bottom', }, { trigger: '.o_attach_document', @@ -29,28 +28,28 @@ tour.register('hr_expense_tour' , { }, { trigger: '.o_expense_submit', extra_triggger: ".o_expense_form", - content: _t('

Click on Create Report to create the report.

'), + content: Markup(_t('

Click on Create Report to create the report.

')), position: 'right', }, { trigger: '.o_expense_tree input[type=checkbox]', - content: _t('

Select expenses to submit them to your manager

'), + content: Markup(_t('

Select expenses to submit them to your manager

')), position: 'bottom' }, { trigger: '.o_dropdown_toggler', extra_trigger: ".o_expense_tree", - content: _t('

Click on Action Create Report to submit selected expenses to your manager

'), + content: Markup(_t('

Click on Action Create Report to submit selected expenses to your manager

')), position: 'right', }, { trigger: '.o_expense_sheet_submit', - content: _t('Once your Expense report is ready, you can submit it to your manager and wait for the approval from your manager.'), + content: Markup(_t('Once your Expense report is ready, you can submit it to your manager and wait for the approval from your manager.')), position: 'bottom', }, { trigger: '.o_expense_sheet_approve', - content: _t("

Approve the report here.

Tip: if you refuse, don’t forget to give the reason thanks to the hereunder message tool

"), + content: Markup(_t("

Approve the report here.

Tip: if you refuse, don’t forget to give the reason thanks to the hereunder message tool

")), position: 'bottom', }, { trigger: '.o_expense_sheet_post', - content: _t("

The accountant receive approved expense reports.

He can post journal entries in one click if taxes and accounts are right.

"), + content: Markup(_t("

The accountant receive approved expense reports.

He can post journal entries in one click if taxes and accounts are right.

")), position: 'bottom', }, { trigger: '.o_expense_sheet_pay', diff --git a/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js b/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js index e2bb77bfe61..0b2874f5fd4 100644 --- a/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js +++ b/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js @@ -1,11 +1,10 @@ odoo.define('hr_recruitment.tour', function(require) { "use strict"; -var core = require('web.core'); +const {_t} = require('web.core'); +const {Markup} = require('web.utils'); var tour = require('web_tour.tour'); -var _t = core._t; - tour.register('hr_recruitment_tour',{ url: "/web", rainbowManMessage: _t("
Great job! You hired a new colleague!
Try the Website app to publish job offers online.
"), @@ -13,12 +12,12 @@ tour.register('hr_recruitment_tour',{ sequence: 230, }, [tour.stepUtils.showAppsMenuItem(), { trigger: '.o_app[data-menu-xmlid="hr_recruitment.menu_hr_recruitment_root"]', - content: _t("Let's have a look at how to improve your hiring process."), + content: Markup(_t("Let's have a look at how to improve your hiring process.")), position: 'right', edition: 'community' }, { trigger: '.o_app[data-menu-xmlid="hr_recruitment.menu_hr_recruitment_root"]', - content: _t("Let's have a look at how to improve your hiring process."), + content: Markup(_t("Let's have a look at how to improve your hiring process.")), position: 'bottom', edition: 'enterprise' }, { @@ -62,24 +61,24 @@ tour.register('hr_recruitment_tour',{ }, { trigger: ".oe_kanban_action_button", extra_trigger: '.o_hr_recruitment_kanban', - content: _t("Did you apply by sending an email? Check incoming applications."), + content: Markup(_t("Did you apply by sending an email? Check incoming applications.")), position: "bottom" }, { trigger: ".oe_kanban_card", extra_trigger: '.o_kanban_applicant', - content: _t("Drag this card, to qualify him for a first interview."), + content: Markup(_t("Drag this card, to qualify him for a first interview.")), position: "bottom", run: "drag_and_drop .o_kanban_group:eq(1) ", }, { trigger: ".oe_kanban_card", extra_trigger: '.o_kanban_applicant', - content: _t("Click to view the application."), + content: Markup(_t("Click to view the application.")), position: "bottom", width: 195 }, { trigger: ".o_Chatter .o_ChatterTopbar_buttonSendMessage", extra_trigger: '.o_applicant_form', - content: _t("
Try to send an email to the applicant.
Tips: All emails sent or received are saved in the history here"), + content: Markup(_t("
Try to send an email to the applicant.
Tips: All emails sent or received are saved in the history here")), position: "bottom" }, { trigger: ".o_Chatter .o_Composer_buttonSend", diff --git a/addons/im_livechat/static/src/legacy/public_livechat.js b/addons/im_livechat/static/src/legacy/public_livechat.js index 25445bde1ea..509fccd23d6 100644 --- a/addons/im_livechat/static/src/legacy/public_livechat.js +++ b/addons/im_livechat/static/src/legacy/public_livechat.js @@ -71,31 +71,25 @@ var LivechatButton = Widget.extend({ this._messages = []; this._serverURL = serverURL; }, - willStart: function () { - var self = this; + async willStart() { var cookie = utils.get_cookie('im_livechat_session'); - var ready; - if (!cookie) { - ready = session.rpc('/im_livechat/init', { channel_id: this.options.channel_id }) - .then(function (result) { - if (!result.available_for_me) { - return Promise.reject(); - } - self._rule = result.rule; - }); - } else { + if (cookie) { var channel = JSON.parse(cookie); - ready = session.rpc('/mail/chat_history', { uuid: channel.uuid, limit: 100 }) - .then(function (history) { - self._history = history; - }); + this._history = await session.rpc('/mail/chat_history', {uuid: channel.uuid, limit: 100}); + this._history.reverse().forEach(message => { message.body = utils.Markup(message.body); }); + } else { + const result = await session.rpc('/im_livechat/init', {channel_id: this.options.channel_id}); + if (!result.available_for_me) { + return Promise.reject(); + } + this._rule = result.rule; } - return ready.then(this._loadQWebTemplate.bind(this)); + return this._loadQWebTemplate(); }, start: function () { this.$el.text(this.options.button_text); if (this._history) { - _.each(this._history.reverse(), this._addMessage.bind(this)); + this._history.forEach(m => this._addMessage(m)); this._openChat(); } else if (!config.device.isMobile && this._rule.action === 'auto_popup') { var autoPopupCookie = utils.get_cookie('im_livechat_auto_popup'); @@ -204,6 +198,7 @@ var LivechatButton = Widget.extend({ if (this._messages.some(message => message.getID() === notificationData.id)) { return; } + notificationData.body = utils.Markup(notificationData.body); this._addMessage(notificationData); if (this._chatWindow.isFolded() || !this._chatWindow.isAtBottom()) { this._livechat.incrementUnreadCounter(); diff --git a/addons/im_livechat/static/src/legacy/public_livechat.xml b/addons/im_livechat/static/src/legacy/public_livechat.xml index b5cf12a6ff8..1250bcf4e5a 100644 --- a/addons/im_livechat/static/src/legacy/public_livechat.xml +++ b/addons/im_livechat/static/src/legacy/public_livechat.xml @@ -400,7 +400,7 @@

- +

diff --git a/addons/lunch/static/src/js/lunch_controller_common.js b/addons/lunch/static/src/js/lunch_controller_common.js index e9d86897844..95f3b2bfd6c 100644 --- a/addons/lunch/static/src/js/lunch_controller_common.js +++ b/addons/lunch/static/src/js/lunch_controller_common.js @@ -7,6 +7,7 @@ odoo.define('lunch.LunchControllerCommon', function (require) { var session = require('web.session'); var core = require('web.core'); +const {Markup} = require('web.utils'); var LunchWidget = require('lunch.LunchWidget'); var LunchPaymentDialog = require('lunch.LunchPaymentDialog'); @@ -59,14 +60,17 @@ var LunchControllerCommon = { }, }); }, - _fetchWidgetData: async function () { - this.widgetData = await this._rpc({ + async _fetchWidgetData() { + const widgetData = await this._rpc({ route: '/lunch/infos', params: { user_id: this.searchModel.get('userId'), context: this.context, }, }); + widgetData.wallet = parseFloat(widgetData.wallet).toFixed(2); + (widgetData.alerts || []).forEach(alert => { alert.message = Markup(alert.message); }); + this.widgetData = widgetData; }, /** * Renders and appends the lunch banner widget. @@ -74,12 +78,10 @@ var LunchControllerCommon = { * @private */ _renderLunchWidget: function () { - var self = this; var oldWidget = this.widget; - this.widgetData.wallet = parseFloat(this.widgetData.wallet).toFixed(2); - this.widget = new LunchWidget(this, _.extend(this.widgetData, {edit: this.editMode})); - return this.widget.appendTo(document.createDocumentFragment()).then(function () { - self.$('.o_lunch_content').prepend(self.widget.$el); + this.widget = new LunchWidget(this, Object.assign(this.widgetData, {edit: this.editMode})); + return this.widget.appendTo(document.createDocumentFragment()).then(() => { + this.$('.o_lunch_content').prepend(this.widget.$el); if (oldWidget) { oldWidget.destroy(); } diff --git a/addons/lunch/static/src/xml/lunch.xml b/addons/lunch/static/src/xml/lunch.xml deleted file mode 100644 index d0415545fe3..00000000000 --- a/addons/lunch/static/src/xml/lunch.xml +++ /dev/null @@ -1,29 +0,0 @@ - - -
-

This is the first time you order a meal

-

Select a product and put your order comments on the note.

-

Your favorite meals will be created based on your last orders.

-

Don't forget the alerts displayed in the reddish area

-
-
-
-

-
- -
- - - - -
-
- -
-
-
-
-
diff --git a/addons/lunch/static/src/xml/lunch_templates.xml b/addons/lunch/static/src/xml/lunch_templates.xml index 6cc7872189f..035f5c2da56 100644 --- a/addons/lunch/static/src/xml/lunch_templates.xml +++ b/addons/lunch/static/src/xml/lunch_templates.xml @@ -3,7 +3,7 @@
diff --git a/addons/lunch/static/tests/lunch_list_tests.js b/addons/lunch/static/tests/lunch_list_tests.js index cca644a52a9..3dbcfabea8f 100644 --- a/addons/lunch/static/tests/lunch_list_tests.js +++ b/addons/lunch/static/tests/lunch_list_tests.js @@ -73,11 +73,12 @@ QUnit.module('LunchListView', { position: "after" }, user_location: [2, "Office 2"], + alerts: [{id: 42, message: 'Warning! Neurotoxin pressure has reached dangerously unlethal levels.'}] }; }, }, function () { QUnit.test('basic rendering', async function (assert) { - assert.expect(6); + assert.expect(9); const list = await createLunchView({ View: LunchListView, @@ -108,6 +109,11 @@ QUnit.module('LunchListView', { assert.containsOnce(list, '.o_lunch_content > span > .o_lunch_banner', "should have a 'lunch' banner"); + const $alertMessage = list.$('.alert > *'); + assert.equal($alertMessage.length, 1); + assert.equal($alertMessage.prop('tagName'), 'B'); + assert.equal($alertMessage.text(), "Warning! Neurotoxin pressure has reached dangerously unlethal levels.") + list.destroy(); }); diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml index c92dede9b57..4897f6e09a9 100644 --- a/addons/lunch/views/lunch_product_views.xml +++ b/addons/lunch/views/lunch_product_views.xml @@ -121,7 +121,7 @@
    -
  • +
@@ -165,7 +165,7 @@
    -
  • +
diff --git a/addons/mail/static/src/js/activity.js b/addons/mail/static/src/js/activity.js index eb87a819ede..4bc4761fc62 100644 --- a/addons/mail/static/src/js/activity.js +++ b/addons/mail/static/src/js/activity.js @@ -539,109 +539,6 @@ var BasicActivity = AbstractField.extend({ }, }); -// ----------------------------------------------------------------------------- -// Activities Widget for Form views ('mail_activity' widget) -// ----------------------------------------------------------------------------- -// FIXME seems to still be needed in some cases like systray -var Activity = BasicActivity.extend({ - className: 'o_mail_activity', - events: _.extend({}, BasicActivity.prototype.events, { - 'click a': '_onClickRedirect', - }), - specialData: '_fetchSpecialActivity', - /** - * @override - */ - init: function () { - this._super.apply(this, arguments); - this._activities = this.record.specialData[this.name]; - }, - /** - * @override - */ - destroy: function () { - this._unbindOnUploadAction(); - return this._super.apply(this, arguments); - }, - - //------------------------------------------------------------ - // Private - //------------------------------------------------------------ - /** - * @private - * @param {Object} fieldsToReload - */ - _reload: function (fieldsToReload) { - this.trigger_up('reload_mail_fields', fieldsToReload); - }, - /** - * @override - * @private - */ - _render: function () { - _.each(this._activities, function (activity) { - var note = mailUtils.parseAndTransform(activity.note || '', mailUtils.inline); - var is_blank = (/^\s*$/).test(note); - if (!is_blank) { - activity.note = mailUtils.parseAndTransform(activity.note, mailUtils.addLink); - } else { - activity.note = ''; - } - }); - var activities = setFileUploadID(setDelayLabel(this._activities)); - if (activities.length) { - var nbActivities = _.countBy(activities, 'state'); - this.$el.html(QWeb.render('mail.activity_items', { - uid: session.uid, - activities: activities, - nbPlannedActivities: nbActivities.planned, - nbTodayActivities: nbActivities.today, - nbOverdueActivities: nbActivities.overdue, - dateFormat: time.getLangDateFormat(), - datetimeFormat: time.getLangDatetimeFormat(), - session: session, - widget: this, - })); - this._bindOnUploadAction(this._activities); - } else { - this._unbindOnUploadAction(this._activities); - this.$el.empty(); - } - }, - /** - * @override - * @private - * @param {Object} record - */ - _reset: function (record) { - this._super.apply(this, arguments); - this._activities = this.record.specialData[this.name]; - // the mail widgets being persistent, one need to update the res_id on reset - this.res_id = record.res_id; - }, - - //------------------------------------------------------------ - // Handlers - //------------------------------------------------------------ - - /** - * @private - * @param {MouseEvent} ev - */ - _onClickRedirect: function (ev) { - var id = $(ev.currentTarget).data('oe-id'); - if (id) { - ev.preventDefault(); - var model = $(ev.currentTarget).data('oe-model'); - this.trigger_up('redirect', { - res_id: id, - res_model: model, - }); - } - }, - -}); - // ----------------------------------------------------------------------------- // Activities Widget for Kanban views ('kanban_activity' widget) // ----------------------------------------------------------------------------- @@ -861,5 +758,3 @@ field_registry .add('kanban_activity', KanbanActivity) .add('list_activity', ListActivity) .add('activity_exception', ActivityException); - -export default Activity; diff --git a/addons/mail/static/src/js/tours/mail.js b/addons/mail/static/src/js/tours/mail.js index 90b6a49ad62..85b16cc592b 100644 --- a/addons/mail/static/src/js/tours/mail.js +++ b/addons/mail/static/src/js/tours/mail.js @@ -1,20 +1,19 @@ /** @odoo-module **/ -import core from 'web.core'; +import {_t} from 'web.core'; +import {Markup} from 'web.utils'; import tour from 'web_tour.tour'; -var _t = core._t; - tour.register('mail_tour', { url: "/web#action=mail.widgets.discuss", sequence: 80, }, [{ trigger: '.o_DiscussSidebar_groupChannel .o_DiscussSidebar_groupHeaderItemAdd', - content: _t("

Channels make it easy to organize information across different topics and groups.

Try to create your first channel (e.g. sales, marketing, product XYZ, after work party, etc).

"), + content: Markup(_t("

Channels make it easy to organize information across different topics and groups.

Try to create your first channel (e.g. sales, marketing, product XYZ, after work party, etc).

")), position: 'bottom', }, { trigger: '.o_DiscussSidebar_itemNewInput', - content: _t("

Create a channel here.

"), + content: Markup(_t("

Create a channel here.

")), position: 'bottom', auto: true, run: function (actions) { @@ -23,14 +22,14 @@ tour.register('mail_tour', { }, }, { trigger: ".o_DiscussSidebar_newChannelAutocompleteSuggestions", - content: _t("

Create a public or private channel.

"), + content: Markup(_t("

Create a public or private channel.

")), position: 'right', run() { this.$consumeEventAnchors.find('li:first').click(); }, }, { trigger: '.o_Discuss_thread .o_ComposerTextInput_textarea', - content: _t("

Write a message to the members of the channel here.

You can notify someone with '@' or link another channel with '#'. Start your message with '/' to get the list of possible commands.

"), + content: Markup(_t("

Write a message to the members of the channel here.

You can notify someone with '@' or link another channel with '#'. Start your message with '/' to get the list of possible commands.

")), position: "top", width: 350, run: function (actions) { @@ -43,7 +42,7 @@ tour.register('mail_tour', { position: "top", }, { trigger: '.o_Discuss_thread .o_Message_commandStar', - content: _t("Messages can be starred to remind you to check back later."), + content: Markup(_t("Messages can be starred to remind you to check back later.")), position: "bottom", }, { trigger: '.o_DiscussSidebarItem.o-starred-box', @@ -51,6 +50,6 @@ tour.register('mail_tour', { position: "bottom", }, { trigger: '.o_DiscussSidebar_groupChat .o_DiscussSidebar_groupHeaderItemAdd', - content: _t("

Chat with coworkers in real-time using direct messages.

You might need to invite users from the Settings app first.

"), + content: Markup(_t("

Chat with coworkers in real-time using direct messages.

You might need to invite users from the Settings app first.

")), position: 'bottom', }]); diff --git a/addons/mail/static/src/widgets/discuss_invite_partner_dialog/discuss_invite_partner_dialog.js b/addons/mail/static/src/widgets/discuss_invite_partner_dialog/discuss_invite_partner_dialog.js index 479bc7f583d..c2c5f5bc936 100644 --- a/addons/mail/static/src/widgets/discuss_invite_partner_dialog/discuss_invite_partner_dialog.js +++ b/addons/mail/static/src/widgets/discuss_invite_partner_dialog/discuss_invite_partner_dialog.js @@ -30,7 +30,7 @@ const PartnerInviteDialog = Dialog.extend({ this.channelId = channel.id; this.env = env; this._super(parent, { - title: _.str.sprintf(this.env._t("Invite people to #%s"), owl.utils.escape(channel.displayName)), + title: _.str.sprintf(this.env._t("Invite people to #%s"), channel.displayName), size: 'medium', buttons: [{ text: this.env._t("Invite"), diff --git a/addons/mail/static/src/xml/activity.xml b/addons/mail/static/src/xml/activity.xml index ec83191b4fe..74735cf214c 100644 --- a/addons/mail/static/src/xml/activity.xml +++ b/addons/mail/static/src/xml/activity.xml @@ -1,113 +1,5 @@ - - -
- -
-
-
- - -
-
-
-
- : - “” - - for - - -
-
-
Activity type
-
- -
-
Created on
-
- - by - - -
-
Assigned to
-
- - - , due on -
-
-
-
-
- -
- -
- -
- - : - Preview - or - Send Now -
-
-
-
-
- -
-
-
-
-
-
- -
- - - Mark Done - - - - Upload Document - - - - - /web/binary/upload_attachment - - - - - - Edit - - - Cancel - -
-