diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 5aca260bc12..143c5514141 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -273,6 +273,7 @@
+
@@ -426,6 +427,7 @@
+
diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml
index 2de4d6176b0..64e1cf22156 100644
--- a/addons/account_voucher/account_voucher_view.xml
+++ b/addons/account_voucher/account_voucher_view.xml
@@ -111,6 +111,7 @@
+
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index 45144be24d4..503c3aeaa5e 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -240,6 +240,7 @@
+
@@ -408,6 +409,7 @@
+
diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml
index 965e2600f24..5bcecfa268e 100644
--- a/addons/account_voucher/voucher_sales_purchase_view.xml
+++ b/addons/account_voucher/voucher_sales_purchase_view.xml
@@ -147,6 +147,7 @@
+
@@ -301,6 +302,7 @@
+
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index 165af37888d..3231b1e6d95 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -297,7 +297,6 @@ class account_analytic_account(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
- self.message_subscribe(cr, uid, [obj.id], [obj.user_id.id], context=context)
self.message_append_note(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), context=context)
account_analytic_account()
diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml
index ccd77638fd9..16100e73fff 100644
--- a/addons/analytic/analytic_view.xml
+++ b/addons/analytic/analytic_view.xml
@@ -45,6 +45,7 @@
+
diff --git a/addons/base_calendar/crm_meeting_view.xml b/addons/base_calendar/crm_meeting_view.xml
index c6826786379..51d17ed43f8 100644
--- a/addons/base_calendar/crm_meeting_view.xml
+++ b/addons/base_calendar/crm_meeting_view.xml
@@ -233,6 +233,7 @@
+
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index a0ec728a4d8..146417a7abb 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -859,13 +859,10 @@ class crm_lead(base_stage, osv.osv):
# OpenChatter methods and notifications
# ----------------------------------------
- def message_get_subscribers(self, cr, uid, ids, context=None):
- """ Override to add the salesman. """
- user_ids = super(crm_lead, self).message_get_subscribers(cr, uid, ids, context=context)
- for obj in self.browse(cr, uid, ids, context=context):
- if obj.user_id and not obj.user_id.id in user_ids:
- user_ids.append(obj.user_id.id)
- return user_ids
+ def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
+ """ Add 'user_id' to the monitored fields """
+ res = super(crm_lead, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
+ return res + ['user_id']
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
""" Override of the (void) default notification method. """
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index dd7743bc26b..e56215f3332 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -222,6 +222,7 @@
+
@@ -532,6 +533,7 @@
+
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index 8ffa8dd591e..da08f97250a 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -271,7 +271,6 @@ class crm_phonecall(base_state, osv.osv):
def case_open_send_note(self, cr, uid, ids, context=None):
lead_obj = self.pool.get('crm.lead')
for phonecall in self.browse(cr, uid, ids, context=context):
- phonecall.message_subscribe([phonecall.user_id.id], context=context)
if phonecall.opportunity_id:
lead = phonecall.opportunity_id
# convert datetime field to a datetime, using server format, then
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 9081ea15637..3b5162288a4 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -154,6 +154,7 @@
+
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index cf5d1a780e8..820fb38e58a 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -182,6 +182,7 @@
+
diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml
index 02c6603280a..5399c9880ca 100644
--- a/addons/crm_helpdesk/crm_helpdesk_view.xml
+++ b/addons/crm_helpdesk/crm_helpdesk_view.xml
@@ -100,6 +100,7 @@
+
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 289316110e6..27829129c15 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -196,6 +196,7 @@
+
@@ -477,6 +478,7 @@
+
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 506b9d7183f..a810b87dad0 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -120,6 +120,7 @@
+
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 7eedfa54ce5..45c65511a1a 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -366,15 +366,11 @@ class hr_holidays(osv.osv):
result[obj.id] = hr_manager_group['users']
return result
- def message_get_subscribers(self, cr, uid, ids, context=None):
- """ Override to add employee and its manager. """
- user_ids = super(hr_holidays, self).message_get_subscribers(cr, uid, ids, context=context)
- for obj in self.browse(cr, uid, ids, context=context):
- if obj.user_id and not obj.user_id.id in user_ids:
- user_ids.append(obj.user_id.id)
- if obj.employee_id.parent_id and not obj.employee_id.parent_id.user_id.id in user_ids:
- user_ids.append(obj.employee_id.parent_id.user_id.id)
- return user_ids
+ def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
+ """ Add 'user_id' and 'manager' to the monitored fields """
+ res = super(hr_holidays, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
+ # TODO: add manager
+ return res + ['user_id']
def create_notificate(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 0030a2b0187..711d07bbfe8 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -137,6 +137,7 @@
+
@@ -183,6 +184,7 @@
+
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 2e5b7b6403e..0ace2574d65 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -461,13 +461,10 @@ class hr_applicant(base_stage, osv.Model):
# OpenChatter methods and notifications
# -------------------------------------------------------
- def message_get_subscribers(self, cr, uid, ids, context=None):
- """ Override to add responsible user. """
- user_ids = super(hr_applicant, self).message_get_subscribers(cr, uid, ids, context=context)
- for obj in self.browse(cr, uid, ids, context=context):
- if obj.user_id and not obj.user_id.id in user_ids:
- user_ids.append(obj.user_id.id)
- return user_ids
+ def message_get_monitored_follower_fields(self, cr, uid, ids, context=None):
+ """ Add 'user_id' to the monitored fields """
+ res = super(hr_applicant, self).message_get_monitored_follower_fields(cr, uid, ids, context=context)
+ return res + ['user_id']
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
""" Override of the (void) default notification method. """
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 8a6296cd230..0e74473f853 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -181,6 +181,7 @@
+
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index 18c81a497d0..eab3d03ceea 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -78,6 +78,7 @@
+
diff --git a/addons/mail/__init__.py b/addons/mail/__init__.py
index d7a3d1a6fdb..289b9080fe7 100644
--- a/addons/mail/__init__.py
+++ b/addons/mail/__init__.py
@@ -21,9 +21,9 @@
import mail_alias
import mail_message
+import mail_followers
import mail_thread
import mail_group
-import mail_subscription
import ir_needaction
import res_partner
import res_users
diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py
index fea3d603f6a..0e1caabcf65 100644
--- a/addons/mail/__openerp__.py
+++ b/addons/mail/__openerp__.py
@@ -64,7 +64,7 @@ The main features of the module are:
'wizard/mail_compose_message_view.xml',
'res_config_view.xml',
'mail_message_view.xml',
- 'mail_subscription_view.xml',
+ 'mail_followers_view.xml',
'mail_thread_view.xml',
'mail_group_view.xml',
'res_partner_view.xml',
@@ -102,9 +102,11 @@ The main features of the module are:
'js': [
'static/lib/jquery.expander/jquery.expander.js',
'static/src/js/mail.js',
+ 'static/src/js/mail_followers.js',
],
'qweb': [
'static/src/xml/mail.xml',
+ 'static/src/xml/mail_followers.xml',
],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mail/mail_subscription.py b/addons/mail/mail_followers.py
similarity index 80%
rename from addons/mail/mail_subscription.py
rename to addons/mail/mail_followers.py
index fc82af879a9..fcdc78d5f0a 100644
--- a/addons/mail/mail_subscription.py
+++ b/addons/mail/mail_followers.py
@@ -22,18 +22,21 @@
from osv import osv
from osv import fields
-class mail_subscription(osv.osv):
- """
- mail_subscription holds the data related to the follow mechanism inside OpenERP.
+class mail_followers(osv.Model):
+ """ mail_followers holds the data related to the follow mechanism inside
+ OpenERP. Users can choose to follow documents (records) of any kind that
+ inherits from mail.thread. Following documents allow to receive
+ notifications for new messages.
A subscription is characterized by:
:param: res_model: model of the followed objects
:param: res_id: ID of resource (may be 0 for every objects)
:param: user_id: user_id of the follower
"""
- _name = 'mail.subscription'
+ _name = 'mail.followers'
_rec_name = 'id'
+ _log_access = False
_order = 'res_model asc'
- _description = 'Mail subscription'
+ _description = 'Mail Document Followers'
_columns = {
'res_model': fields.char('Related Document Model', size=128,
required=True, select=1,
@@ -44,10 +47,8 @@ class mail_subscription(osv.osv):
ondelete='cascade', required=True, select=1),
}
-class mail_notification(osv.osv):
- """
- mail_notification is a relational table modeling messages pushed to users.
- :param: read: not used currently
+class mail_notification(osv.Model):
+ """ mail_notification is a relational table modeling messages pushed to users.
"""
_name = 'mail.notification'
_rec_name = 'id'
@@ -59,9 +60,4 @@ class mail_notification(osv.osv):
ondelete='cascade', required=True, select=1),
'message_id': fields.many2one('mail.message', string='Message',
ondelete='cascade', required=True, select=1),
- 'read': fields.boolean('Read', help="Not used currently",),
- # TODO: add a timestamp ? or use message date ?
- }
- _defaults = {
- 'read': False,
}
diff --git a/addons/mail/mail_subscription_view.xml b/addons/mail/mail_followers_view.xml
similarity index 61%
rename from addons/mail/mail_subscription_view.xml
rename to addons/mail/mail_followers_view.xml
index 19e31cf8fc9..62e93430675 100644
--- a/addons/mail/mail_subscription_view.xml
+++ b/addons/mail/mail_followers_view.xml
@@ -2,16 +2,14 @@
-
-
-
- mail.subscription.tree
- mail.subscription
+
+
+ mail.followers.tree
+ mail.followers
+ tree
10
-
+
@@ -19,26 +17,22 @@
-
-
+
mail.notification.tree
mail.notification
10
-
+
-
-
- Subscriptions
- mail.subscription
+
+ Followers
+ mail.followers
form
tree,form
@@ -50,9 +44,9 @@
tree,form
-
- -->
+
+ -->