diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 977409c9d15..3c82754c676 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -651,9 +651,9 @@ class mail_thread(osv.Model): return self.message_append_dict(cr, uid, ids, msg_dict, context=context) def message_thread_followers(self, cr, uid, ids, context=None): - """Returns a list of email addresses of the people following - this thread, including the sender of each mail, and the - people who were in CC of the messages, if any. + """ Returns a list of email addresses of the people following + this thread, including the sender of each mail, and the + people who were in CC of the messages, if any. """ res = {} if isinstance(ids, (str, int, long)): @@ -807,9 +807,9 @@ class mail_thread(osv.Model): """ Returns the current document followers. Basically this method checks in mail.subscription for entries with matching res_model, res_id. - - :param get_ids: if set to True, return the ids of users; if set - to False, returns the result of a read in res.users + This method can be overriden to add implicit subscribers, such + as project managers, by adding their user_id to the list of + ids returned by this method. """ subscr_obj = self.pool.get('mail.subscription') subscr_ids = subscr_obj.search(cr, uid, ['&', ('res_model', '=', self._name), ('res_id', 'in', ids)], context=context) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index da6e89246c7..bceced31666 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -20,6 +20,55 @@ openerp.mail = function(session) { */ var mail_msg_struct = mail.chatter_message_structure = {}; // TODO: USE IT OR NOT :) + + + + /** + * ------------------------------------------------------------ + * ComposeMessage widget + * ------------------------------------------------------------ + * + * This widget handles the display of a form to compose a new message. + */ + + /* Add ComposeMessage widget to registry */ + session.web.form.widgets.add('compose_message', 'openerp.mail.ComposeMessage'); + + /* ComposeMessage is an extension of a Widget */ + mail.compose_message = session.web.Widget.extend({ + template: 'mail.compose_message', + + init: function(parent, params) { + this._super(parent); + console.log(params); + this.ds_compose = new session.web.DataSet(this, 'mail.compose.message'); + this.form_view = new session.web.FormView(this, this.ds_compose, false, { + action_buttons: false, + pager: false, + initial_mode: 'edit', + } + ); + }, + + start: function(parent, params) { + this._super.apply(this, arguments); + console.log('start'); + console.log(this); + var node = this.$element.find('div.caca'); + var node = this.$element.find('p'); + console.log(node); + var done = this.form_view.appendTo(node); + return done; + }, + + destroy: function(parent, params) { + this._super.apply(this, arguments); + }, + }), + + + + /** * Thread widget: this widget handles the display of a thread of * messages. The [thread_level] parameter sets the thread level number: @@ -92,6 +141,11 @@ openerp.mail = function(session) { else var display_done = this.init_comments(); // customize display $.when(display_done).then(this.proxy('do_customize_display')); + + // add form view + this.caca = new mail.compose_message(); + this.caca.appendTo(this.$element.find('div.oe_mail_thread_act')); + return display_done }, diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 25c45a63dfb..80a43fd16a2 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -44,6 +44,11 @@ + +

cacaproutboudin

+
+
+