[ADD] mail_thread: added doc for message_state.

bzr revid: tde@openerp.com-20120621085649-ze61cs41p2h14dtx
This commit is contained in:
Thibault Delavallée
2012-06-21 10:56:49 +02:00
parent c98b9d625e
commit 790bf251eb
+28
View File
@@ -0,0 +1,28 @@
.. _mail_state:
message_state
=============
``message_state`` is a boolean field that states whether the document
has unread messages. In previous versions, some documents were going
back to ``pending`` state when receiving an email through the mail
gateway. Now the state related to messages differs from the state or
stage of the document itself.
message_state and need action mechanism
+++++++++++++++++++++++++++++++++++++++
The ``mail`` module introduces a default behavior for the need_action
mechanism [REF].
::
def get_needaction_user_ids(self, cr, uid, ids, context=None):
""" Returns the user_ids that have to perform an action
:return: dict { record_id: [user_ids], }
"""
result = super(ir_needaction_mixin, self).get_needaction_user_ids(cr, uid, ids, context=context)
for obj in self.browse(cr, uid, ids, context=context):
if obj.message_state == False and obj.user_id:
result[obj.id].add(obj.user_id.id)
return result