diff --git a/addons/mail/static/src/js/basic_model.js b/addons/mail/static/src/js/basic_model.js
new file mode 100644
index 00000000000..11139819a60
--- /dev/null
+++ b/addons/mail/static/src/js/basic_model.js
@@ -0,0 +1,33 @@
+odoo.define('mail.basic_model', function (require) {
+"use strict";
+
+var BasicModel = require('web.BasicModel');
+
+/**
+ * Include the BasicModel to update the datapoint on the model when a
+ * message is posted.
+ */
+BasicModel.include({
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ /**
+ * Update the message ids on a datapoint.
+ *
+ * Note that we directly update the res_ids on the datapoint as the message
+ * has already been posted ; this change can't be handled 'normally' with
+ * x2m commands because the change won't be saved as a normal field.
+ *
+ * @param {string} id
+ * @param {integer[]} msgIDs
+ */
+ updateMessageIDs: function (id, msgIDs) {
+ var element = this.localData[id];
+ element.res_ids = msgIDs;
+ element.count = msgIDs.length;
+ },
+});
+
+});
diff --git a/addons/mail/static/src/js/form_controller.js b/addons/mail/static/src/js/form_controller.js
new file mode 100644
index 00000000000..b8cb5ab1c25
--- /dev/null
+++ b/addons/mail/static/src/js/form_controller.js
@@ -0,0 +1,31 @@
+
+odoo.define('mail.form_controller', function (require) {
+"use strict";
+
+var FormController = require('web.FormController');
+
+/**
+ * Include the FormController to update the datapoint on the model when a
+ * message is posted.
+ */
+FormController.include({
+ custom_events: _.extend({}, FormController.prototype.custom_events, {
+ new_message: '_onNewMessage',
+ }),
+
+ //--------------------------------------------------------------------------
+ // Handlers
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * @param {OdooEvent} event
+ * @param {string} event.data.id datapointID
+ * @param {integer[]} event.data.msgIDs list of message ids
+ */
+ _onNewMessage: function (event) {
+ this.model.updateMessageIDs(event.data.id, event.data.msgIDs);
+ },
+});
+
+});
diff --git a/addons/mail/static/src/js/form_renderer.js b/addons/mail/static/src/js/form_renderer.js
index 4a0d98da4df..bc77fc5acab 100644
--- a/addons/mail/static/src/js/form_renderer.js
+++ b/addons/mail/static/src/js/form_renderer.js
@@ -1,9 +1,7 @@
odoo.define('mail.form_renderer', function (require) {
"use strict";
-var BasicModel = require('web.BasicModel');
var Chatter = require('mail.Chatter');
-var FormController = require('web.FormController');
var FormRenderer = require('web.FormRenderer');
/**
@@ -92,51 +90,4 @@ FormRenderer.include({
},
});
-/**
- * Include the FormController and BasicModel to update the datapoint on the
- * model when a message is posted.
- */
-FormController.include({
- custom_events: _.extend({}, FormController.prototype.custom_events, {
- new_message: '_onNewMessage',
- }),
-
- //--------------------------------------------------------------------------
- // Handlers
- //--------------------------------------------------------------------------
-
- /**
- * @private
- * @param {OdooEvent} event
- * @param {string} event.data.id datapointID
- * @param {integer[]} event.data.msgIDs list of message ids
- */
- _onNewMessage: function (event) {
- this.model.updateMessageIDs(event.data.id, event.data.msgIDs);
- },
-});
-
-BasicModel.include({
-
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
-
- /**
- * Update the message ids on a datapoint.
- *
- * Note that we directly update the res_ids on the datapoint as the message
- * has already been posted ; this change can't be handled 'normally' with
- * x2m commands because the change won't be saved as a normal field.
- *
- * @param {string} id
- * @param {integer[]} msgIDs
- */
- updateMessageIDs: function (id, msgIDs) {
- var element = this.localData[id];
- element.res_ids = msgIDs;
- element.count = msgIDs.length;
- },
-});
-
});
diff --git a/addons/mail/views/mail_templates.xml b/addons/mail/views/mail_templates.xml
index 63c403ba637..8c4ab97754b 100644
--- a/addons/mail/views/mail_templates.xml
+++ b/addons/mail/views/mail_templates.xml
@@ -15,7 +15,9 @@
+
+