diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-10-18 11:34:53 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-10-18 11:34:53 +0200 |
| commit | 1737a3161b5c98eb6977d2e9b0ee90c50b4a355b (patch) | |
| tree | 3cfb8c4582e2db49e8cc3660ca4acab902f637c4 | |
| parent | 1c7859c67a70c50b5ae42306d3bbb78c897e95b8 (diff) | |
[REVIEW] Cleaning before merging.
bzr revid: tde@openerp.com-20121018093453-trijh79z0j7oha6f
| -rw-r--r-- | addons/email_template/wizard/mail_compose_message_view.xml | 1 | ||||
| -rw-r--r-- | addons/mail/mail_message.py | 14 | ||||
| -rw-r--r-- | addons/mail/mail_thread.py | 4 | ||||
| -rw-r--r-- | addons/mail/security/mail_security.xml | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/js/mail_followers.js | 2 |
5 files changed, 10 insertions, 13 deletions
diff --git a/addons/email_template/wizard/mail_compose_message_view.xml b/addons/email_template/wizard/mail_compose_message_view.xml index c2fe7dc6157..a33135ca098 100644 --- a/addons/email_template/wizard/mail_compose_message_view.xml +++ b/addons/email_template/wizard/mail_compose_message_view.xml @@ -17,7 +17,6 @@ </group> </xpath> <xpath expr="//form/footer/button" position="after"> - <button icon="/email_template/static/src/img/email_template.png" type="object" name="toggle_template" string="" help="Use a message template" diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 5d541fd71a1..b8c1edc8032 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -208,6 +208,7 @@ class mail_message(osv.Model): 'is_author': message['author_id'] and message['author_id'][0] == uid, 'partner_ids': partner_ids, 'parent_id': message['parent_id'] and message['parent_id'][0] or False, + # TDE note: see with CHM about votes, how they are displayed (only number, or name_get ?) # 'vote_user_ids': vote_ids, 'has_voted': has_voted, 'to_read': message['to_read'], @@ -216,7 +217,7 @@ class mail_message(osv.Model): def _message_read_expandable(self, cr, uid, tree, result, message_loaded, domain, context, parent_id, limit): """ Create the expandable message for all parent message read this function is used by message_read - TDE note: place use default values for args, and comment your vars !! + TDE note: add default values for args, add some comments :param dict tree: tree of message ids """ @@ -280,7 +281,7 @@ class mail_message(osv.Model): 'type', 'vote_user_ids', 'attachment_ids', 'author_id', 'partner_ids', 'record_name'] def _get_parent(self, cr, uid, message, context=None): - """ Tools method that try to get the parent of a mail.message. If + """ Tools method that tries to get the parent of a mail.message. If no parent, or if uid has no access right on the parent, False is returned. @@ -301,6 +302,8 @@ class mail_message(osv.Model): After having fetch messages, their parents will be added to obtain well formed threads. + TDE note: update this comment after final method implementation + :param domain: optional domain for searching ids :param limit: number of messages to fetch :param parent_id: if parent_id reached, stop searching for @@ -314,15 +317,12 @@ class mail_message(osv.Model): if context.get('message_loaded'): domain += [('id', 'not in', context.get('message_loaded'))] limit = limit or self._message_read_limit - # tree = [] - # result = [] - record = None - id_tree = [] message_list = [] + record = None # select ids - # TDE note: should not receive [None] !! + # TDE note: should not receive [None] -> investigate if ids and ids != [None]: for message in self.read(cr, uid, ids, self._message_read_fields, context=context): message_list.append(self._message_get_dict(cr, uid, message, context=context)) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 944ef1299bd..7c92e9158e3 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -706,8 +706,8 @@ class mail_thread(osv.AbstractModel): attachment_ids = ir_attachment.search(cr, SUPERUSER_ID, [('res_model', '=', False), ('res_id', '=', False), ('user_id', '=', uid), ('id', 'in', attachments)], context=context) if attachment_ids: ir_attachment.write(cr, SUPERUSER_ID, attachment_ids, {'res_model': self._name, 'res_id': thread_id}, context=context) - mail_message.write(cr, SUPERUSER_ID, [new_message_id], {'attachment_ids': [(6, 0, [pid for pid in attachment_ids])]}) - new_message = self.pool.get('mail.message').message_read(cr, uid, [new_message_id]) + mail_message.write(cr, SUPERUSER_ID, [new_message_id], {'attachment_ids': [(6, 0, [pid for pid in attachment_ids])]}, context=context) + new_message = self.pool.get('mail.message').message_read(cr, uid, [new_message_id], context=context) return new_message diff --git a/addons/mail/security/mail_security.xml b/addons/mail/security/mail_security.xml index c8d37f333c7..53083a51d5a 100644 --- a/addons/mail/security/mail_security.xml +++ b/addons/mail/security/mail_security.xml @@ -13,7 +13,6 @@ <record id="mail_followers_read_own" model="ir.rule"> <field name="name">mail.followers: read its own entries</field> <field name="model_id" ref="model_mail_followers"/> - <!-- This rule has to be improved for employee only groups --> <field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field> <field name="perm_create" eval="False"/> <field name="perm_unlink" eval="False"/> @@ -21,7 +20,6 @@ <!-- This rule can not be uncommented, because we have a more wide method in mail.message. When we implement a many2one_variable field, we will be able to uncomment this. - <record id="mail_message_read_partner_or_author" model="ir.rule"> <field name="name">mail.message: read if notified or author</field> <field name="model_id" ref="model_mail_message"/> diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index ab45d27eef6..a422c6b4762 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -216,7 +216,7 @@ openerp_mail_followers = function(session, mail) { var checklist = new Array(); _(this.$('.oe_mail_recthread_actions input[type="checkbox"]')).each(function (record) { if ($(record).is(':checked')) { - checklist.push(parseInt($(record).data('id'))) + checklist.push(parseInt($(record).data('id'))); } }); |
