diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index 6bb8e2700d4..1abcdac9712 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -146,6 +146,7 @@ Lead Created + crm.lead Lead created @@ -171,6 +172,7 @@ Lead Created + 10 crm.case.section @@ -178,18 +180,21 @@ Opportunity Stage Changed + 11 crm.case.section section_id Opportunity Won + 12 crm.case.section section_id Opportunity Lost + 13 crm.case.section diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml index e1ca797670b..4a2dc6d06f0 100644 --- a/addons/mail/data/mail_data.xml +++ b/addons/mail/data/mail_data.xml @@ -54,6 +54,7 @@ Discussions + diff --git a/addons/mail/mail_message_subtype.py b/addons/mail/mail_message_subtype.py index bef6e427c3b..bae4d941a52 100644 --- a/addons/mail/mail_message_subtype.py +++ b/addons/mail/mail_message_subtype.py @@ -29,6 +29,8 @@ class mail_message_subtype(osv.osv): on the Wall. """ _name = 'mail.message.subtype' _description = 'Message subtypes' + _order = 'sequence, id' + _columns = { 'name': fields.char('Message Type', required=True, translate=True, help='Message subtype gives a more precise type on the message, '\ @@ -50,7 +52,11 @@ class mail_message_subtype(osv.osv): help="Model the subtype applies to. If False, this subtype applies to all models."), 'default': fields.boolean('Default', help="Activated by default when subscribing."), + 'sequence': fields.integer('Sequence', help="Used to order subtypes."), + 'hidden': fields.boolean('Hidden', help="Hide the subtype in the follower options") } + _defaults = { 'default': True, + 'sequence': 1, } diff --git a/addons/mail/mail_message_subtype.xml b/addons/mail/mail_message_subtype.xml index a79f5815bd1..efcb81b5794 100644 --- a/addons/mail/mail_message_subtype.xml +++ b/addons/mail/mail_message_subtype.xml @@ -9,6 +9,7 @@ + @@ -22,12 +23,18 @@
- - - - - - + + + + + + + + + + + +
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 063b45c8c64..876d10d0f2c 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -20,6 +20,7 @@ ############################################################################## import base64 +from collections import OrderedDict import datetime import dateutil import email @@ -185,8 +186,17 @@ class mail_thread(osv.AbstractModel): # find current model subtypes, add them to a dictionary subtype_obj = self.pool.get('mail.message.subtype') - subtype_ids = subtype_obj.search(cr, uid, ['|', ('res_model', '=', self._name), ('res_model', '=', False)], context=context) - subtype_dict = dict((subtype.name, dict(default=subtype.default, followed=False, id=subtype.id)) for subtype in subtype_obj.browse(cr, uid, subtype_ids, context=context)) + subtype_ids = subtype_obj.search( + cr, uid, [ + '&', ('hidden', '=', False), '|', ('res_model', '=', self._name), ('res_model', '=', False) + ], context=context) + subtype_dict = OrderedDict( + (subtype.name, { + 'default': subtype.default, + 'followed': False, + 'parent_model': subtype.parent_id and subtype.parent_id.res_model or self._name, + 'id': subtype.id} + ) for subtype in subtype_obj.browse(cr, uid, subtype_ids, context=context)) for id in ids: res[id]['message_subtype_data'] = subtype_dict.copy() diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 50e190c846d..614077b65a2 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -760,4 +760,8 @@ .openerp .oe_sidebar_suggestion .oe_suggest_items:hover a.oe_suggestion_remove_item { visibility: visible; } +.subtype-border { + border-bottom: 1px solid #dddddd; + margin-bottom: 10px; +} diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index c103e4d4ab2..e7c8ede6867 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -265,7 +265,15 @@ openerp_mail_followers = function(session, mail) { var records = data[id].message_subtype_data; this.records_length = $.map(records, function(value, index) { return index; }).length; if (this.records_length > 1) { self.display_followers(); } + var old_model = ''; _(records).each(function (record, record_name) { + if (old_model != record.parent_model){ + if (old_model != ''){ + var index = $($list).find('.oe_subtype').length; + $($($list).find('.oe_subtype')[index-1]).addClass('subtype-border'); + } + old_model = record.parent_model; + } record.name = record_name; record.followed = record.followed || undefined; $(session.web.qweb.render('mail.followers.subtype', {'record': record})).appendTo($list); diff --git a/addons/project/project_data.xml b/addons/project/project_data.xml index 7ddc983bf1c..95a76d8988e 100644 --- a/addons/project/project_data.xml +++ b/addons/project/project_data.xml @@ -78,6 +78,7 @@ Task Created project.task + Task created
@@ -101,6 +102,7 @@ Task Created + 10 project.project @@ -108,6 +110,7 @@ Task Assigned + 11 project.project @@ -115,12 +118,14 @@ Task Blocked + 12 project.project project_id Task Stage Changed + 13 project.project project_id diff --git a/addons/project_issue/project_issue_data.xml b/addons/project_issue/project_issue_data.xml index 25a336d4094..d60106dffd2 100644 --- a/addons/project_issue/project_issue_data.xml +++ b/addons/project_issue/project_issue_data.xml @@ -33,6 +33,7 @@ Access all issues from the top Project menu, and access the issues of a specific Issue Created project.issue + Issue created @@ -56,6 +57,7 @@ Access all issues from the top Project menu, and access the issues of a specific Issue Created + 20 project.project @@ -63,6 +65,7 @@ Access all issues from the top Project menu, and access the issues of a specific Issue Assigned + 21 project.project @@ -70,12 +73,14 @@ Access all issues from the top Project menu, and access the issues of a specific Issue Blocked + 22 project.project project_id Issue Stage Changed + 23 project.project Stage changed diff --git a/addons/sale_crm/sale_crm_data.xml b/addons/sale_crm/sale_crm_data.xml index 519af2a976b..1996f367202 100644 --- a/addons/sale_crm/sale_crm_data.xml +++ b/addons/sale_crm/sale_crm_data.xml @@ -5,12 +5,14 @@ Quotation Send + 20 crm.case.section section_id Sales Order Confirmed + 21 crm.case.section section_id