diff --git a/addons/mail/mail_group_view.xml b/addons/mail/mail_group_view.xml
index f83baf10d73..67b2efc84a0 100644
--- a/addons/mail/mail_group_view.xml
+++ b/addons/mail/mail_group_view.xml
@@ -69,7 +69,8 @@
-
+
diff --git a/addons/mail/res_partner_view.xml b/addons/mail/res_partner_view.xml
index ac0612f0bfb..892ee4e2b2f 100644
--- a/addons/mail/res_partner_view.xml
+++ b/addons/mail/res_partner_view.xml
@@ -13,7 +13,8 @@
False
-
+
@@ -30,4 +31,4 @@
-
\ No newline at end of file
+
diff --git a/addons/mail/res_users_view.xml b/addons/mail/res_users_view.xml
index 90da5ef6a04..e489b616cd5 100644
--- a/addons/mail/res_users_view.xml
+++ b/addons/mail/res_users_view.xml
@@ -28,7 +28,8 @@
-
+
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index bed8faea5e0..1ec6fe32eb5 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -476,10 +476,12 @@ openerp.mail = function(session) {
// QWeb template to use when rendering the object
template: 'RecordThread',
- init: function() {
+ init: function() {
this._super.apply(this, arguments);
this.see_subscribers = true;
this.thread = null;
+ this.params = this.get_definition_options();
+ this.params.thread_level = this.params.thread_level || 0;
// datasets
this.ds = new session.web.DataSet(this, this.view.model);
this.ds_users = new session.web.DataSet(this, 'res.users');
@@ -520,12 +522,8 @@ openerp.mail = function(session) {
// create and render Thread widget
this.$element.find('div.oe_mail_recthread_left').empty();
if (this.thread) this.thread.destroy();
- // hack: for groups and users
- if (this.view.model == 'mail.group') thread_level = 1;
- if (this.view.model == 'res.users') thread_level = 1;
- else thread_level = 0;
this.thread = new mail.Thread(this, {'res_model': this.view.model, 'res_id': this.view.datarecord.id, 'uid': this.session.uid,
- 'thread_level': thread_level, 'show_post_comment': true, 'limit': 15});
+ 'thread_level': this.params.thread_level, 'show_post_comment': true, 'limit': 15});
var thread_done = this.thread.appendTo(this.$element.find('div.oe_mail_recthread_left'));
return fetch_sub_done && thread_done;
},