Browse Source

[11.0][MIG] web_send_message_popup: Migrate to 11.0

pull/1051/head
Artem Kostyuk 6 years ago
parent
commit
70f347784f
  1. 62
      web_send_message_popup/README.rst
  2. 1
      web_send_message_popup/__init__.py
  3. 35
      web_send_message_popup/__manifest__.py
  4. 14
      web_send_message_popup/i18n/web_send_message_popup.pot
  5. 4
      web_send_message_popup/readme/CONTRIBUTORS.rst
  6. 8
      web_send_message_popup/readme/DESCRIPTION.rst
  7. 3
      web_send_message_popup/readme/ROADMAP.rst
  8. 45
      web_send_message_popup/static/src/js/chatter.js
  9. 2
      web_send_message_popup/templates/assets.xml

62
web_send_message_popup/README.rst

@ -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
<https://github.com/OCA/web/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 <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Nicolas JEUDY <https://github.com/njeudy>
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.

1
web_send_message_popup/__init__.py

@ -1 +0,0 @@
# -*- coding: utf-8 -*-

35
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',
],
}

14
web_send_message_popup/i18n/web_send_message_popup.pot

@ -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"

4
web_send_message_popup/readme/CONTRIBUTORS.rst

@ -0,0 +1,4 @@
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Nicolas JEUDY <https://github.com/njeudy>
* Artem Kostyuk <a.kostyuk@mobilunity.com>

8
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.

3
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.

45
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();
}
});
});
});

2
web_send_message_popup/views/web_send_message_popup.xml → web_send_message_popup/templates/assets.xml

@ -2,7 +2,7 @@
<odoo>
<template id="assets_backend" name="web_send_message_popup assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_send_message_popup/static/src/js/chatter.js"></script>
<script type="text/javascript" src="/web_send_message_popup/static/src/js/chatter.js"/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save