Skip to Content
Menú
This question has been flagged

I've been wanting to add custom message subtypes on my odoo v8, in order to track changes on particular fields. Specifically, Description, and Work Summary. 

I've implemented the necessary message subtypes, but it seems that it's not working, though Odoo did not show any error. If it's working, followers of that task will be notified (with an addition to the unread message count). Here's my code for making "Description" work initially.

project.py

_track = { 
'description': {
'project.mt_desc': lambda self, cr, uid, obj, ctx=None: obj.description,
},
}
_columns = {
'description': fields.text('Description', track_visibility='onchange'),
}


project_data.xml

<record id="mt_desc" model="mail.message.subtype">
<field name="name">Description</field>
<field name="res_model">project.task</field>
<field name="default" eval="True"/>
<field name="description">Description</field>
</record>
<record id="mt_project_desc" model="mail.message.subtype">
<field name="name">Description</field>
<field name="sequence">14</field>
<field name="res_model">project.project</field>
<field name="parent_id" eval="ref('mt_desc')"/>
<field name="relation_field">project_id</field>
</record>
 

 And I realized that the "Description" option is not appearing in the drop down list.

I had to manually create a subtype through Settings > Email > Subtype using the GUI in order to let it show, but it does not have any effect whatsoever.


UPDATE : I just found out that I was able to log the changes through the use of track_visibility='onchange' on the "description" field, which can be seen in the open chatter log. But it does not increase the needaction counter indicating unread messages. So I went on to troubleshoot and found that the change is registered as a message ( Settings > Email > Messages), but not as a notification ( Settings > Email > Notification ). I think this is the why there is no increase in needaction counter for unread messages.

Looking forward to your valuable insights on this. Thanks.  

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de maig 16
3743
2
de juny 25
725
0
de maig 17
4535
0
de maig 16
3842
1
de març 15
4308