mirror of https://github.com/OCA/web.git
Merge pull request #1051 from arkostyuk/11.0-mig-web_send_message_popup
[11.0][MIG] web_send_message_popup: Migrate to 11.0pull/1081/head
commit
b508fd8018
|
@ -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',
|
||||
],
|
||||
}
|
|
@ -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>
|
|
@ -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.
|
|
@ -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.
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
|
@ -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…
Reference in New Issue