diff --git a/web_send_message_popup/README.rst b/web_send_message_popup/README.rst deleted file mode 100644 index 686ec9c5..00000000 --- a/web_send_message_popup/README.rst +++ /dev/null @@ -1,62 +0,0 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -========================= -Web Send Message as Popup -========================= - -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. - - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/162/10.0 - - -Bug Tracker -=========== - -This module was tested on Odoo 10.0 community and enterprise. - -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. - -Credits -======= - -Images ------- - -* Odoo Community Association: `Icon `_. - -Contributors ------------- - -* Guewen Baconnier -* Yannick Vaucher -* Nicolas JEUDY - -Maintainer ----------- - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -This module is maintained by the OCA. - -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -To contribute to this module, please visit https://odoo-community.org. diff --git a/web_send_message_popup/__init__.py b/web_send_message_popup/__init__.py index 40a96afc..e69de29b 100644 --- a/web_send_message_popup/__init__.py +++ b/web_send_message_popup/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/web_send_message_popup/__manifest__.py b/web_send_message_popup/__manifest__.py index cc26c63f..5d3de433 100644 --- a/web_send_message_popup/__manifest__.py +++ b/web_send_message_popup/__manifest__.py @@ -1,17 +1,18 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Camptocamp SA -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -{'name': 'Web Send Message as Popup', - 'version': '10.0.1.0.0', - 'author': "Camptocamp, Odoo Community Association (OCA)", - 'maintainer': 'Camptocamp', - 'license': 'AGPL-3', - 'category': 'Hidden', - 'depends': ['web', - ], - 'website': 'http://www.camptocamp.com', - 'data': ['views/web_send_message_popup.xml' - ], - 'installable': True, - 'auto_install': False, - } +# 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/i18n/web_send_message_popup.pot b/web_send_message_popup/i18n/web_send_message_popup.pot deleted file mode 100644 index b662aad9..00000000 --- a/web_send_message_popup/i18n/web_send_message_popup.pot +++ /dev/null @@ -1,14 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" -"Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - 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 index d15dfd97..89f88544 100644 --- a/web_send_message_popup/static/src/js/chatter.js +++ b/web_send_message_popup/static/src/js/chatter.js @@ -1,29 +1,28 @@ -/* © 2016 Camptocamp SA +/* 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"; + "use strict"; -var core = require('web.core'); -var composer = require('mail.composer'); -var Chatter = core.form_widget_registry.get('mail_thread'); + var Chatter = require('mail.Chatter'); -Chatter.include({ - on_open_composer_new_message: function () { - var self = this; - this.open_composer(); - // wait for composer input to be initialized - // taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait - function checkVariable() { - if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') { - self.composer.on_open_full_composer(); - } - else { - setTimeout(function() { - checkVariable(); - }, 50); - } + 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(); + }); } - checkVariable(); - } -}); + }); }); diff --git a/web_send_message_popup/views/web_send_message_popup.xml b/web_send_message_popup/templates/assets.xml similarity index 88% rename from web_send_message_popup/views/web_send_message_popup.xml rename to web_send_message_popup/templates/assets.xml index 4acc483e..6634d738 100644 --- a/web_send_message_popup/views/web_send_message_popup.xml +++ b/web_send_message_popup/templates/assets.xml @@ -2,7 +2,7 @@