From 68907dbabd177a8bc1f373957bb8b10a1722fa67 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 21 Nov 2012 11:15:03 +0100 Subject: [PATCH 1/3] [IMP] mail_message: documentation~ bzr revid: chm@openerp.com-20121121101503-1h1pplhn81nhcyj3 --- addons/mail/doc/mail_message.rst | 66 ++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/addons/mail/doc/mail_message.rst b/addons/mail/doc/mail_message.rst index 56244e251bf..5d78923dabd 100644 --- a/addons/mail/doc/mail_message.rst +++ b/addons/mail/doc/mail_message.rst @@ -6,23 +6,65 @@ mail.message Models +++++++ -``mail.message.common`` is an abstract class for holding the main attributes of a -message object. It could be reused as parent model for any database model -or wizard screen that needs to hold a kind of message. +``mail.message`` is a class for holding the main attributes of a message object +(notification for system message, reciving email message or sent messages). It +could be reused as parent model for any database model, wall thread view, or +wizard screen that needs to hold a kind of message. All internal logic should be in a database-based model while this model holds the basics of a message. For example, a wizard for writing emails -should inherit from this class and not from mail.message. +should inherit from this class. .. versionchanged:: 7.0 - - ``subtype`` is renamed to ``content_subtype``: usually 'html' or 'plain'. - This field is used to select plain-text or rich-text contents accordingly. - - ``subtype`` is moved to mail.message model. The purpose is to be able to - distinguish message of the same type, such as notifications about creating - or cancelling a record. For example, it is used to add the possibility - to hide notifications in the wall. +Fields ++++++++ -Those changes aim at being able to distinguish the message content to the -message itself. + - ``type`` : usually 'email', 'comment', 'notification'. + Message type: email for external email message recieve, notification for system + message, comment for other messages such as user replies. + - ``subtype_id`` : + Subtype of the notification for system message. The users can followe a document + and choose the subtype of this document (eg: Create, Comment, Done). + You can defined new subtypes and choose his name, by agreement the id begin by "mt_" on the model + "mail.message.subtype". + - ``partner_ids`` : + List of recipients, the recipients have this message in their personal mailboxe. + - ``notified_partner_ids`` : + Partners that have a notification pushing this message in their mailboxes. Usualy + it's an automatic system message for a model followed by users. + - ``notification_ids`` : + Technical field holding the message notifications. Use notified_partner_ids to access + notified partners. + - ``attachment_ids`` : + List of attachments + - ``parent_id`` : + It's the initial thread message. It's use for group message by thread in mailboxes. + - ``child_ids`` : + List of child message linked to the initial thread message. + - ``model`` : + Related Document Moded. It's use for group message by document. + - ``res_id`` : + Related Document ID. It's use for group message by document. + - ``record_name`` : + Functionnal field use to get the name of related document. + - ``vote_user_ids`` : + List of partner that vote/like this message. + - ``to_read`` : + Functional field to search for messages the current user has to read. The messages as + treat like a need action. When the user recive a message (to_read = True) this message + or action must be performed and mark done (to_read = False) + - ``favorite_user_ids`` : + Users that set this message in their favorites/todo list. + +Methods ++++++++ + + - ``message_read`` : + Value: ids, domain, message_unload_ids, thread_level, context, parent_id, limit + Return: List of dictinary of message. All message is sent with their parented messages and + sort by id. The messages that the user can read but not in his search, are group in + expandable messages. The expandable messages contain the domain to expand. + - ``check_access_rule`` : + Overwrite the initial message for this model. \ No newline at end of file From 50fcf01492e5fc118826518360eafc2cc3ec6aae Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 23 Nov 2012 10:46:59 +0100 Subject: [PATCH 2/3] [IMP] mail: add documentations and comments bzr revid: chm@openerp.com-20121123094659-sgkha5v1o3paqzw8 --- addons/mail/doc/mail_message.rst | 35 +++++++++++++++++++++++++++++++ addons/mail/static/src/js/mail.js | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/addons/mail/doc/mail_message.rst b/addons/mail/doc/mail_message.rst index 5d78923dabd..78eaeab8155 100644 --- a/addons/mail/doc/mail_message.rst +++ b/addons/mail/doc/mail_message.rst @@ -18,6 +18,41 @@ should inherit from this class. .. versionchanged:: 7.0 +ClientAction (ir.actions.client) ++++++++ + + Inbox + mail.wall + mail.message + + + + + + - ``tag`` : 'mail.wall', 'mail_thread' or 'mail.widget' + 'mail.wall' to have a display like the mail wall with threads, title, search view + (default value like a wall) + 'mail_thread' widget for field on standard view. (default value like a thread for + record, view on flat mode, no reply, no read/unread) + 'mail.widget' it's the root thread, used by 'mail.wall' and 'mail_thread' + - ``help`` : Text HTML to display if there are no message + - ``context`` : insert 'default_model' and 'default_res_id' + - ``params`` : options for the widget + - ``domain`` : choose the domain of the messages + - ``truncate_limit`` : {Number} number of character to display before having a "show more" + link; note that the text will not be truncated if it does not have 110% of the parameter + - ``show_record_name`` : {Boolean} display the name and link of the related record + - ``show_reply_button`` : {Boolean} display the reply button + - ``show_read_unread_button`` : {Boolean} display the read/unread button + - ``display_indented_thread`` : {int [0,1]} number thread level to indented threads. + - ``show_compose_message`` : display the composer on top thread + - ``show_compact_message`` : display the compact message on the thread when the user clic + on this compact mode, the composer is open + - ``message_ids`` : {Array | False} List of ids to fetch by the root thread. If no value, + the root search the message by the domain + - ``help`` : Message to display when there are no message. + - ``compose_placeholder`` : Message to display on the textareaboxes. + Fields +++++++ diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 040b83e8f33..980904180b0 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1429,7 +1429,8 @@ openerp.mail = function (session) { * when the user clic on this compact mode, the composer is open *... @param {Array} [message_ids] List of ids to fetch by the root thread. * When you use this option, the domain is not used for the fetch root. - * @param {String} [no_message] Message to display when there are no message + * @param {String} [help] Message to display when there are no message. + * @param {String} [compose_placeholder] Message to display on the textareaboxes. */ init: function (parent, action) { this._super(parent, action); From 3e91a0a80b271658d6d02ef9e8ee3a1c70b8d52e Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 3 Dec 2012 10:23:17 +0100 Subject: [PATCH 3/3] [IMP] mail: doc bzr revid: chm@openerp.com-20121203092317-cq9xbl9g4xgn58kq --- addons/mail/doc/mail_message.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/doc/mail_message.rst b/addons/mail/doc/mail_message.rst index 78eaeab8155..4a3d3634efa 100644 --- a/addons/mail/doc/mail_message.rst +++ b/addons/mail/doc/mail_message.rst @@ -50,8 +50,9 @@ ClientAction (ir.actions.client) on this compact mode, the composer is open - ``message_ids`` : {Array | False} List of ids to fetch by the root thread. If no value, the root search the message by the domain - - ``help`` : Message to display when there are no message. - ``compose_placeholder`` : Message to display on the textareaboxes. + - ``show_link`` : Display partner (authors, followers...) on link or not + - ``compose_as_todo`` : The root composer mark automatically the message as todo Fields +++++++