diff --git a/addons/mail/mail_group_view.xml b/addons/mail/mail_group_view.xml
index d205caf87d1..bf2b3bea732 100644
--- a/addons/mail/mail_group_view.xml
+++ b/addons/mail/mail_group_view.xml
@@ -109,9 +109,8 @@
-
-
-
+
+
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index b13d9a3d389..47927e4cfd0 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -183,6 +183,7 @@ class mail_message(osv.osv):
('notification', 'Notification'),
], 'Type', help="Message type: e-mail for e-mail message, notification for system message, comment for other messages such as user replies"),
'need_action': fields.boolean('Need action', help="Asks the user to perform an action"),
+ 'need_action_user_id': fields.many2one('res.users', 'Action user', help="User requested to perform an action"),
}
_defaults = {
@@ -195,6 +196,7 @@ class mail_message(osv.osv):
#------------------------------------------------------
def create(self, cr, uid, vals, context=None):
+ print vals
msg_id = super(mail_message, self).create(cr, uid, vals, context)
# push the message to suscribed users
subscription_obj = self.pool.get('mail.subscription')
diff --git a/addons/mail/mail_subscription.py b/addons/mail/mail_subscription.py
index e56a8e5a192..c5b5407190b 100644
--- a/addons/mail/mail_subscription.py
+++ b/addons/mail/mail_subscription.py
@@ -32,11 +32,11 @@ class mail_subscription(osv.osv):
- res_id: ID of resource OR
- res_domain: a domain filtering followed objects - currently removed
"""
-
_name = 'mail.subscription'
_rec_name = 'id'
_columns = {
- 'res_model': fields.char('Related Document Model', size=128, select=1, required=True),
+ 'res_model': fields.char('Related Document Model', size=128,
+ select=1, required=True),
'res_id': fields.integer('Related Document ID', select=1),
#'res_domain': fields.char('res_domain', size=256),
'user_id': fields.integer('Related User ID', select=1, required=True),
@@ -60,9 +60,7 @@ class mail_notification(osv.osv):
'read': fields.boolean('Read'),
# TODO: add a timestamp ? or use message date ?
}
-
_defaults = {
'read': False,
}
-
mail_notification()
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index a23d8292b31..132653ba3b0 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -64,9 +64,9 @@ class mail_thread(osv.osv):
# TODO remove this and copy method, this will be replaced by message_load
_columns = {
'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', readonly=True),
- 'message_ids_tmp': fields.function(_get_message_ids, method=True,
- type='one2many', obj='mail.message', string='Temp messages'),
- 'thread_view': fields.char('ThreadView', size=64, widget='mail.ThreadView'),
+ 'message_ids_social': fields.function(_get_message_ids, method=True,
+ type='one2many', obj='mail.message', string='Temp messages',
+ widget='mail.ThreadView'),
}
#------------------------------------------------------
diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml
index 7b60c79caab..8b3afe362cd 100644
--- a/addons/mail/mail_thread_view.xml
+++ b/addons/mail/mail_thread_view.xml
@@ -12,8 +12,8 @@
-
+
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 9073313f980..2571cce7462 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -9,16 +9,22 @@ openerp.mail = function(session) {
mail.ThreadView = session.web.form.Field.extend({
// QWeb template to use when rendering the object
template: 'MailTest',
- // autogenerated id prefix, specificity helps when debugging
-// identifier_prefix: 'my-id-prefix-',
init: function() {
- this.timeout;
+// this.timeout;
this._super.apply(this, arguments);
this.ds = new session.web.DataSet(this, this.view.model);
},
+
+ start: function() {
+ var self = this;
+ this._super.apply(this, arguments);
+ self.$element.find('button.oe_mail_action_follow').bind('click', function () { self.do_follow(); });
+ self.$element.find('button.oe_mail_action_unfollow').bind('click', function () { self.do_unfollow(); });
+ },
+
stop: function () {
- clearTimeout(this.timeout);
+// clearTimeout(this.timeout);
this._super();
},
@@ -34,12 +40,27 @@ openerp.mail = function(session) {
},
display_records: function (records) {
- // this.$element.empty();
+ console.log(records);
+// this.$element.empty();
var self = this;
_(records).each(function (record) {
+ $('
').text(record.user_id[1]).appendTo(self.$element);
+// $('
').text(record.user_id['1']).appendTo(self.$element);
+// $('
').text(record.body_text).appendTo(self.$element);
$('
').text(record.body_text).appendTo(self.$element);
+// $('
').text(record.user_id).appendTo(self.$element);
});
- this.timeout = setTimeout(this.proxy('fetch_messages'), 5000);
+// this.timeout = setTimeout(this.proxy('fetch_messages'), 5000);
+ },
+
+ do_follow: function () {
+ var self = this;
+ console.log('Follow');
+ },
+
+ do_unfollow: function () {
+ var self = this;
+ console.log('Unfollow');
}
});
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index c5c1b64cbd2..ad9c886fab3 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -2,7 +2,17 @@
- vdvgfxdfxdfv
+
+
+
Bladivoctock !
+
Blougiboulga !!
+
Ouagadougou