diff --git a/web_send_message_popup/__init__.py b/web_send_message_popup/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web_send_message_popup/__manifest__.py b/web_send_message_popup/__manifest__.py new file mode 100644 index 00000000..5d3de433 --- /dev/null +++ b/web_send_message_popup/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2014-2018 Camptocamp SA +# License AGPL-3.0 or later (http://gnu.org/licenses/agpl). +{ + 'name': 'Web Send Message as Popup', + 'version': '11.0.1.0.0', + 'author': "Camptocamp, Odoo Community Association (OCA)", + 'maintainer': 'Camptocamp', + 'license': 'AGPL-3', + 'category': 'Hidden', + 'depends': [ + 'web', + 'mail', + ], + 'website': 'https://github.com/OCA/web', + 'data': [ + 'templates/assets.xml', + ], +} diff --git a/web_send_message_popup/readme/CONTRIBUTORS.rst b/web_send_message_popup/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..614c0f83 --- /dev/null +++ b/web_send_message_popup/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Guewen Baconnier +* Yannick Vaucher +* Nicolas JEUDY +* Artem Kostyuk diff --git a/web_send_message_popup/readme/DESCRIPTION.rst b/web_send_message_popup/readme/DESCRIPTION.rst new file mode 100644 index 00000000..c661e1b3 --- /dev/null +++ b/web_send_message_popup/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +In the email/notes threads below the form views, the link 'Send a +message' unfold a text field. From there, a button allows to open the +text field in a full featured email popup with the subject, templates, +attachments and followers. + +This module changes the link 'Send a message' so it opens directly the +full featured popup instead of the text field, avoiding an extra click +if the popup is always wanted. diff --git a/web_send_message_popup/readme/ROADMAP.rst b/web_send_message_popup/readme/ROADMAP.rst new file mode 100644 index 00000000..ca2a85a2 --- /dev/null +++ b/web_send_message_popup/readme/ROADMAP.rst @@ -0,0 +1,3 @@ +* works even if bit flickering as it renders 1st the std widget and then shows the + other one. @simahawk checked the code and unfortunately seems there's no good + way to hook if not overriding whole big functions. diff --git a/web_send_message_popup/static/src/js/chatter.js b/web_send_message_popup/static/src/js/chatter.js new file mode 100644 index 00000000..89f88544 --- /dev/null +++ b/web_send_message_popup/static/src/js/chatter.js @@ -0,0 +1,28 @@ +/* Copyright 2018 Camptocamp SA + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ +odoo.define('web_send_message_popup.Chatter', function (require) { + "use strict"; + + var Chatter = require('mail.Chatter'); + + Chatter.include({ + _onOpenComposerMessage: function () { + // wait for composer input to be initialized + // taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait + var self = this; + $.when(this._super.apply(this, arguments)).then(function () { + function checkVariable() { + if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') { + self.composer.on_open_full_composer(); + } + else { + setTimeout(function () { + checkVariable(); + }, 50); + } + } + checkVariable(); + }); + } + }); +}); diff --git a/web_send_message_popup/templates/assets.xml b/web_send_message_popup/templates/assets.xml new file mode 100644 index 00000000..6634d738 --- /dev/null +++ b/web_send_message_popup/templates/assets.xml @@ -0,0 +1,8 @@ + + +