From 790bf251eb7135b09a04e312669ea31b2635575d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 21 Jun 2012 10:56:49 +0200 Subject: [PATCH] [ADD] mail_thread: added doc for message_state. bzr revid: tde@openerp.com-20120621085649-ze61cs41p2h14dtx --- addons/mail/doc/mail_state.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 addons/mail/doc/mail_state.rst diff --git a/addons/mail/doc/mail_state.rst b/addons/mail/doc/mail_state.rst new file mode 100644 index 00000000000..bd8052656d2 --- /dev/null +++ b/addons/mail/doc/mail_state.rst @@ -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