[MERGE] [IMP] mail: Inbox usability improvements :
authorAmit Vora <avo@tinyerp.com>
Thu, 17 Apr 2014 09:41:33 +0000 (11:41 +0200)
committerThibault Delavallée <tde@openerp.com>
Thu, 17 Apr 2014 09:41:33 +0000 (11:41 +0200)
- notficiation_email_send field, renamed into notify_email, has now 2 values: always or never, in
order to ease the choice and simplify options.
- inbox: removed 'compose a new messages or write to my followers', because those 2 options are
already available. The first one is accessible using the top-right email icon, the second one
is accessible with the 'write to my followers' text box alread present in the inbox.

bzr revid: tde@openerp.com-20140417094133-8ip7vuy6b30xlc32

1  2 
addons/mail/mail_followers.py
addons/mail/res_partner.py
addons/mail/static/src/xml/mail.xml
addons/mail/tests/test_mail_features.py

@@@ -96,14 -96,11 +96,8 @@@ class mail_notification(osv.Model)
              if message.author_id and message.author_id.email == partner.email:
                  continue
              # Partner does not want to receive any emails or is opt-out
-             if partner.notification_email_send == 'none':
-                 continue
-             # Partner wants to receive only emails and comments
-             if partner.notification_email_send == 'comment' and message.type not in ('email', 'comment'):
-                 continue
-             # Partner wants to receive only emails
-             if partner.notification_email_send == 'email' and message.type != 'email':
+             if partner.notify_email == 'none':
                  continue
 -            # Partner wants to receive emails, comments and notification
 -            if partner.notify_email == 'always' and message.type not in ('email', 'comment', 'notification'):
 -                continue
              notify_pids.append(partner.id)
          return notify_pids
  
@@@ -28,19 -28,14 +28,16 @@@ class res_partner_mail(osv.Model)
      _name = "res.partner"
      _inherit = ['res.partner', 'mail.thread']
      _mail_flat_thread = False
 +    _mail_mass_mailing = _('Customers')
  
      _columns = {
-         'notification_email_send': fields.selection([
+         'notify_email': fields.selection([
              ('none', 'Never'),
-             ('email', 'Incoming Emails only'),
-             ('comment', 'Incoming Emails and Discussions'),
-             ('all', 'All Messages (discussions, emails, followed system notifications)'),
-             ], 'Receive Messages by Email', required=True,
+             ('always', 'All Messages'),
 -            ], 'Receive Messages by Email', required=True,
++            ], 'Receive Inbox Notifications by Email', required=True,
++            oldname='notification_email_send',
              help="Policy to receive emails for new messages pushed to your personal Inbox:\n"
                      "- Never: no emails are sent\n"
-                     "- Incoming Emails only: for messages received by the system via email\n"
-                     "- Incoming Emails and Discussions: for incoming emails along with internal discussions\n"
                      "- All Messages: for every notification you receive in your Inbox"),
      }
  
                  </td>
                  <td><div class="oe_view_manager_view_search" t-opentag="true"/></td>
              </tr>
--            <tr class="oe_header_row" t-if="widget.action.params.view_inbox and widget.action.params.show_compose_message" >
--                <td colspan="2">
--                    <button type="button" class="oe_write_full oe_highlight">
--                        Compose a new message
--                    </button>
--                    <span class='oe_alternative'>
--                        or
--                        <a href='#'  class='oe_write_onwall oe_bold' help='Your followers can read this message'>Write to my followers</a>
--                    </span>
--                </td>
--            </tr>
            </tbody>
          </table>
          <div class="oe_mail-placeholder"></div>