mail_thread._message_get_auto_subscribe_fields needs a tracking_visibility to track a field
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
Concerns the method openerp.
def _message_
""" Returns the list of relational fields linking to res.users that should
trigger an auto subscribe. The default list checks for the fields
- called 'user_id'
- linking to res.users
- with track_visibility set
In OpenERP V7, this is sufficent for all major addon such as opportunity,
that automatically subscribe users.
"""
for name, column_info in self._all_
if name in auto_follow_fields and name in updated_fields and getattr(
return user_field_lst
(BTW, unrelated to my issue but the auto_follow_fields arg should probably not be a mutable argument.)
Use case:
I create a model, I want to automatically subscribe a 'specialist_
Note: the model does not automatically track and displays the changes.
class my_model(
_name = 'my.model'
_inherit = ['mail.thread']
_columns = {
'name': fields.
}
def _message_
return super(my_model, self)._
Result:
user_id and specialist_user_id are not subscribed when changed
Expected:
user_id and specialist_user_id are subscribed when changed
Note:
If I put the _columns:
_columns = {
'name': fields.
}
It works, but I don't understand what is the relation between the track_visibility and the auto subscription.
I think that's 2 different things and that I shouldn't need to define a track_visibility to subscribe the users.
Workaround:
Define the columns with a dummy track_visibility as follows:
_columns = {
'name': fields.
}
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 19 lines (+1/-2)1 file modifiedmail/mail_thread.py (+1/-2)
- OpenERP Core Team: Pending requested
-
Diff: 19 lines (+1/-2)1 file modifiedmail/mail_thread.py (+1/-2)
description: | updated |
description: | updated |
Hello,
Sorry but it's not something that we want to have currently. We don't want to autoscubscribe every user fields.
We consider autosubscribe fields are quite important (eg: responsible of a task) so it's good to track them (why was I added as follower ? can see in the chatter)
Regards