diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-07-25 20:01:05 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-07-25 20:01:05 +0200 |
| commit | a4b1b532ea09f8cbb5f208fb24b57cbea04ea753 (patch) | |
| tree | 03290dade554f08cf1278ebecaf651c48924342b /addons/mail | |
| parent | 7e5a80abc666bfa4d5b50a2d717a0d0d72a23dbf (diff) | |
| parent | b82df99d7a86fa3bc2670f00a0ef025263362cda (diff) | |
[MERGE] forward port branch 12.0 up to b82df99d7a8
Diffstat (limited to 'addons/mail')
| -rw-r--r-- | addons/mail/static/src/js/activity.js | 7 | ||||
| -rw-r--r-- | addons/mail/static/tests/chatter_tests.js | 67 | ||||
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 1 |
3 files changed, 74 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/activity.js b/addons/mail/static/src/js/activity.js index 68ff4b0b86f..1ee96f18672 100644 --- a/addons/mail/static/src/js/activity.js +++ b/addons/mail/static/src/js/activity.js @@ -383,7 +383,7 @@ var BasicActivity = AbstractField.extend({ container: $markDoneBtn, title : _t("Feedback"), html: true, - trigger:'click', + trigger: 'manual', placement: 'right', // FIXME: this should work, maybe a bug in the popper lib content : function () { var $popover = $(QWeb.render('mail.activity_feedback_form', { @@ -400,6 +400,11 @@ var BasicActivity = AbstractField.extend({ $popover.find('#activity_feedback').focus(); self._bindPopoverFocusout($(this)); }).popover('show'); + } else { + var popover = $markDoneBtn.data('bs.popover'); + if ($('#' + popover.tip.id).length === 0) { + popover.show(); + } } }, /** diff --git a/addons/mail/static/tests/chatter_tests.js b/addons/mail/static/tests/chatter_tests.js index 3f521b74ba6..c8545af6066 100644 --- a/addons/mail/static/tests/chatter_tests.js +++ b/addons/mail/static/tests/chatter_tests.js @@ -1858,6 +1858,73 @@ QUnit.test('form activity widget: schedule next activity', function (assert) { form.destroy(); }); +QUnit.test('form activity widget: do not close activity popover on click', async function (assert) { + assert.expect(3); + this.data.partner.records[0].activity_ids = [1]; + this.data.partner.records[0].activity_state = 'today'; + this.data['mail.activity'].records = [{ + id: 1, + display_name: "An activity", + date_deadline: moment().format("YYYY-MM-DD"), // now + state: "today", + user_id: 2, + create_user_id: 2, + activity_type_id: 2, + }]; + + const form = createView({ + View: FormView, + model: 'partner', + data: this.data, + services: this.services, + arch: `<form string="Partners"> + <sheet> + <field name="foo"/> + </sheet> + <div class="oe_chatter"> + <field name="message_ids" widget="mail_thread"/> + <field name="activity_ids" widget="mail_activity"/> + </div> + </form>`, + res_id: 2, + mockRPC(route, args) { + if (route === '/web/dataset/call_kw/mail.activity/action_feedback_schedule_next') { + return $.when(); + } + return this._super.apply(this, arguments); + }, + intercepts: { + do_action(ev) { + ev.data.options.on_close(); + }, + }, + }); + + //Schedule next activity + await testUtils.dom.click(form.$('.o_mail_activity .o_mark_as_done[data-activity-id=1]')); + + for (let i = 0; i < 2; i++) { + // click twice in feedback area + await testUtils.dom.click(form.$('.o_mail_activity_feedback.popover textarea')); + const $popover = form.$('.o_mail_activity_feedback.popover'); + const $PopoverInDom = form.$(`#${$popover.attr('id')}`); + assert.isVisible( + $PopoverInDom, + "the feedback popover should still be visible on click"); + } + await concurrency.delay(250); // wait for popover transition + const $popover = form.$('.o_mail_activity_feedback.popover'); + if (!$popover) { + throw new Error("popover should be in DOM"); + } + const $PopoverInDom = form.$(`#${$popover.attr('id')}`); + assert.isVisible( + $PopoverInDom, + "the feedback popover should still be visible on click"); + + form.destroy(); +}); + QUnit.test('form activity widget: edit next activity', function (assert) { assert.expect(3); diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 95ae6372c41..a003f2e42c6 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -306,6 +306,7 @@ class MailComposer(models.TransientModel): 'attachment_ids': [attach.id for attach in self.attachment_ids], 'author_id': self.author_id.id, 'email_from': self.email_from, + 'reply_to': self.reply_to, 'record_name': self.record_name, 'no_auto_thread': self.no_auto_thread, 'mail_server_id': self.mail_server_id.id, |
