Thibault Delavallée (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-mail-fix-tde into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-mail-fix-tde/+merge/123297

Post "mail-cleaning-fp merge" fixes
- fixed wrong res_id passed into subthreads
- fixed message_post using a wrong dataset
- basically fixed message_post calling message_fetch with weird values; 
however, the reload does not work correctly. This will be fixed in another 
branch, as the behavior will be slighty modified. Only the automatic reloading 
is incorrect.
- removed dead CSS code
- pre is now displayed using the usual OpenERP fonts
- res_users: added a hook so that already existing users follow themselves when 
installing Social
- fixed issue with user avatars.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-mail-fix-tde/+merge/123297
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-mail-fix-tde.
=== modified file 'mail/res_users.py'
--- mail/res_users.py	2012-09-03 15:20:25 +0000
+++ mail/res_users.py	2012-09-07 15:22:23 +0000
@@ -56,8 +56,11 @@
 
     def _auto_init(self, cr, context=None):
         """Installation hook to create aliases for all users and avoid constraint errors."""
-        self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users,self)._auto_init,
+        self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users, self)._auto_init,
             self._columns['alias_id'], 'login', alias_force_key='id', context=context)
+        # make already existing users follow themselves
+        for user in self.browse(cr, SUPERUSER_ID, self.search(cr, SUPERUSER_ID, [], context=context), context=context):
+            self.pool.get('res.partner').message_subscribe(cr, SUPERUSER_ID, [user.partner_id.id], [user.partner_id.id], context=context)
 
     def create(self, cr, uid, data, context=None):
         # create default alias same as the login

=== modified file 'mail/static/src/css/mail.css'
--- mail/static/src/css/mail.css	2012-09-03 15:20:25 +0000
+++ mail/static/src/css/mail.css	2012-09-07 15:22:23 +0000
@@ -322,11 +322,7 @@
     text-decoration: none;
 }
 
-.openerp .oe_mail_msg_subtitle {
-    margin: 0 0 .5em 0;
-}
-.openerp .oe_mail_msg_footer,
-.openerp .oe_mail_msg_subtitle {
+.openerp .oe_mail_msg_footer {
     color: #888;
 }
 
@@ -340,14 +336,15 @@
     text-align: justify;
 }
 
+.openerp .oe_mail_msg_record_body pre {
+    font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
+    margin: 0px;
+}
+
 .openerp .oe_mail_msg_body span.oe_mail_msg_tail {
     display: inline;
 }
 
-.openerp .oe_mail_oe_bold {
-    font-weight: bold;
-}
-
 /* Read more/less link */
 .openerp .oe_mail_msg_content .oe_mail_reduce {
     position: absolute;

=== modified file 'mail/static/src/js/mail.js'
--- mail/static/src/js/mail.js	2012-09-03 15:20:25 +0000
+++ mail/static/src/js/mail.js	2012-09-07 15:22:23 +0000
@@ -411,7 +411,7 @@
                     self.thread = new mail.Thread(self, {
                         'context': {
                             'default_model': record.model,
-                            'default_id': record.res_id,
+                            'default_res_id': record.res_id,
                             'default_parent_id': record.id },
                         'message_data': record.child_ids, 'thread_level': self.options.thread_level-1,
                         'show_header_compose': false, 'show_reply': self.options.thread_level > 1,
@@ -473,7 +473,7 @@
         },
 
         display_user_avatar: function () {
-            var avatar = mail.ChatterUtils.get_image(this.session.prefix, this.session.session_id, 'res.users', 'image_small', this.options.uid);
+            var avatar = mail.ChatterUtils.get_image(this.session.prefix, this.session.session_id, 'res.users', 'image_small', this.session.uid);
             return this.$el.find('img.oe_mail_icon').attr('src', avatar);
         },
         
@@ -484,9 +484,9 @@
                 var body = comment_node.val();
                 comment_node.val('');
             }
-            return this.ds_post.call('message_post', [
-                [this.options.context.res_id], body, false, 'comment', this.options.context.parent_id]
-                ).then(this.proxy('message_fetch'));
+            return this.ds_thread.call('message_post', [
+                [this.options.context.default_res_id], body, false, 'comment', this.options.context.default_parent_id, undefined]
+                ).then(self.message_fetch());
         },
 
         /** Action: 'shows more' to fetch new messages */

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to