Se rendre au contenu
Menu
Cette question a été signalée

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
Ignorer
Publications associées Réponses Vues Activité
2
mai 16
3732
2
juin 25
690
0
mai 17
4528
0
mai 16
3819
1
mars 15
4288