diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml index 8c38ed41a1c..4a75f5e3729 100644 --- a/addons/crm/crm_lead_menu.xml +++ b/addons/crm/crm_lead_menu.xml @@ -9,7 +9,13 @@ ['|', ('type','=','lead'), ('type','=',False)] - {'default_type':'lead', 'stage_type':'lead'} + { + 'default_type':'lead', + 'stage_type':'lead', + 'search_default_unassigned':1, + 'needaction_menu_ref': 'crm.menu_crm_opportunities', + } +

Click to create an unqualified lead. diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 8261ca35635..914889579a1 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -233,6 +233,8 @@ class mail_message(osv.Model): :param bool read: set notification as (un)read :param bool create_missing: create notifications for missing entries (i.e. when acting on displayed messages not notified) + + :return number of message mark as read """ notification_obj = self.pool.get('mail.notification') user_pid = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0] @@ -243,14 +245,16 @@ class mail_message(osv.Model): # all message have notifications: already set them as (un)read if len(notif_ids) == len(msg_ids) or not create_missing: - return notification_obj.write(cr, uid, notif_ids, {'read': read}, context=context) + notification_obj.write(cr, uid, notif_ids, {'read': read}, context=context) + return len(notif_ids) # some messages do not have notifications: find which one, create notification, update read status notified_msg_ids = [notification.message_id.id for notification in notification_obj.browse(cr, uid, notif_ids, context=context)] to_create_msg_ids = list(set(msg_ids) - set(notified_msg_ids)) for msg_id in to_create_msg_ids: notification_obj.create(cr, uid, {'partner_id': user_pid, 'read': read, 'message_id': msg_id}, context=context) - return notification_obj.write(cr, uid, notif_ids, {'read': read}, context=context) + notification_obj.write(cr, uid, notif_ids, {'read': read}, context=context) + return len(notif_ids) def set_message_starred(self, cr, uid, msg_ids, starred, create_missing=True, context=None): """ Set messages as (un)starred. Technically, the notifications related diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index 75c86e4645d..80dac297175 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -8,6 +8,7 @@ { 'default_model': 'res.users', 'default_res_id': uid, + 'needaction_menu_ref': ['mail.mail_tomefeeds', 'mail.mail_starfeeds'] } { 'default_model': 'res.users', 'default_res_id': uid, - 'search_default_message_unread': True + 'search_default_message_unread': True, + 'needaction_menu_ref': ['mail.mail_starfeeds', 'mail.mail_inboxfeeds'] } mail.wall { 'default_model': 'res.users', - 'default_res_id': uid + 'default_res_id': uid, + 'needaction_menu_ref': ['mail.mail_tomefeeds', 'mail.mail_starfeeds', 'mail.mail_inboxfeeds'] } + + + {'stage_type': 'opportunity', 'default_type': 'opportunity', 'default_user_id': uid, 'needaction_menu_ref': 'sale.menu_sale_quotations'} + + sale.order.inherit sale.order