diff --git a/addons/im_livechat/__manifest__.py b/addons/im_livechat/__manifest__.py
index b7b2517a956..70d5065531d 100644
--- a/addons/im_livechat/__manifest__.py
+++ b/addons/im_livechat/__manifest__.py
@@ -34,9 +34,7 @@ Help your customers with this chat, and analyse their feedback.
'data/mail_shortcode_demo.xml',
],
'depends': ["mail", "rating"],
- 'qweb': [
- 'static/src/xml/im_livechat_backend.xml',
- ],
+ 'qweb': ['static/src/xml/*.xml'],
'installable': True,
'auto_install': False,
'application': True,
diff --git a/addons/im_livechat/static/src/js/copy_clipboard.js b/addons/im_livechat/static/src/js/copy_clipboard.js
new file mode 100644
index 00000000000..0d35e6b35f3
--- /dev/null
+++ b/addons/im_livechat/static/src/js/copy_clipboard.js
@@ -0,0 +1,86 @@
+odoo.define('im_livechat.copy_clipboard', function (require) {
+"use strict";
+
+var core = require('web.core');
+var field_registry = require('web.field_registry');
+var qweb = core.qweb;
+
+var _t = core._t;
+var FieldText = field_registry.get('text');
+var FieldChar = field_registry.get('char');
+
+var CopyClipboard = {
+
+ /**
+ * @override
+ */
+ destroy: function () {
+ this._super.apply(this, arguments);
+ this.clipboard.destroy();
+ },
+
+ //--------------------------------------------------------------------------
+ // Private
+ //--------------------------------------------------------------------------
+
+ /**
+ * Instatiates the Clipboad lib.
+ */
+ _initClipboard: function () {
+ var self = this;
+ var $clipboardBtn = this.$('.o_clipboard_button');
+ $clipboardBtn.tooltip({title: _t('Copied !'), trigger: 'manual', placement: 'right'});
+ this.clipboard = new Clipboard($clipboardBtn.get(0), {
+ text: function () {
+ return self.value.trim();
+ }
+ });
+ this.clipboard.on('success', function () {
+ _.defer(function () {
+ $clipboardBtn.tooltip('show');
+ _.delay(function () {
+ $clipboardBtn.tooltip('hide');
+ }, 800);
+ });
+ });
+ },
+};
+
+var TextCopyClipboard = FieldText.extend(CopyClipboard, {
+
+ //--------------------------------------------------------------------------
+ // Private
+ //--------------------------------------------------------------------------
+
+ /**
+ * @override
+ */
+ _render: function() {
+ this._super.apply(this, arguments);
+ this.$el.addClass('o_field_copy');
+ this.$el.append($(qweb.render('CopyClipboardText')));
+ this._initClipboard();
+ }
+});
+
+var CharCopyClipboard = FieldChar.extend(CopyClipboard, {
+
+ //--------------------------------------------------------------------------
+ // Private
+ //--------------------------------------------------------------------------
+
+ /**
+ * @override
+ */
+ _render: function() {
+ this._super.apply(this, arguments);
+ this.$el.addClass('o_field_copy');
+ this.$el.append($(qweb.render('CopyClipboardChar')));
+ this._initClipboard();
+ }
+});
+
+field_registry
+ .add('CopyClipboardText', TextCopyClipboard)
+ .add('CopyClipboardChar', CharCopyClipboard);
+});
diff --git a/addons/im_livechat/static/src/js/im_livechat_backend.js b/addons/im_livechat/static/src/js/im_livechat_backend.js
index b69d7a28b8c..4d1e514c01b 100644
--- a/addons/im_livechat/static/src/js/im_livechat_backend.js
+++ b/addons/im_livechat/static/src/js/im_livechat_backend.js
@@ -28,4 +28,4 @@ chat_manager.bus.on('new_message', null, function (msg) {
});
});
-});
+});
\ No newline at end of file
diff --git a/addons/im_livechat/static/src/less/copy_clipboard.less b/addons/im_livechat/static/src/less/copy_clipboard.less
new file mode 100644
index 00000000000..1d56022f28e
--- /dev/null
+++ b/addons/im_livechat/static/src/less/copy_clipboard.less
@@ -0,0 +1,20 @@
+// less properties for copy widget
+.o_field_copy {
+ position: relative;
+ border-radius: 5px;
+ border: 1px solid @btn-primary-border;
+ font-size: @font-size-small;
+ color: @odoo-brand-optional;
+ font-weight: @badge-font-weight;
+ text-align: center;
+ .o_clipboard_button {
+ &.o_btn_text_copy {
+ position: absolute;
+ top: 0;
+ right: 0;
+ }
+ &.o_btn_char_copy {
+ padding-top: 2px;
+ }
+ }
+}
diff --git a/addons/im_livechat/static/src/xml/copy_clipboard.xml b/addons/im_livechat/static/src/xml/copy_clipboard.xml
new file mode 100644
index 00000000000..a6c1cb8a197
--- /dev/null
+++ b/addons/im_livechat/static/src/xml/copy_clipboard.xml
@@ -0,0 +1,16 @@
+
+