Browse Source

Merge pull request #1051 from arkostyuk/11.0-mig-web_send_message_popup

[11.0][MIG] web_send_message_popup: Migrate to 11.0
pull/1081/head
Simone Orsi 6 years ago
committed by GitHub
parent
commit
b508fd8018
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      web_send_message_popup/__init__.py
  2. 18
      web_send_message_popup/__manifest__.py
  3. 4
      web_send_message_popup/readme/CONTRIBUTORS.rst
  4. 8
      web_send_message_popup/readme/DESCRIPTION.rst
  5. 3
      web_send_message_popup/readme/ROADMAP.rst
  6. 28
      web_send_message_popup/static/src/js/chatter.js
  7. 8
      web_send_message_popup/templates/assets.xml

0
web_send_message_popup/__init__.py

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

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.

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

8
web_send_message_popup/templates/assets.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<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"/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save