From 02719b328f707d1e9a5b5b937a142f8160710205 Mon Sep 17 00:00:00 2001 From: "ara@tinyerp.com" <> Date: Wed, 13 Jun 2012 11:53:28 +0530 Subject: [FIX] fixe serevr log of project and producyt bzr revid: ara@tinyerp.com-20120613062328-yayadrc2hx2xuwva --- addons/mail/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/mail_thread.py') diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index b1b6c68e4cc..5e2cacbc4fd 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -294,7 +294,7 @@ class mail_thread(osv.osv): } to_attach.append(ir_attachment.create(cr, uid, data_attach, context=context)) - partner_id = hasattr(thread, 'partner_id') and (thread.partner_id and thread.partner_id.id or False) or False + partner_id = ('partner_id' in thread._columns.keys()) and (thread.partner_id and thread.partner_id.id or False) or False if not partner_id and thread._name == 'res.partner': partner_id = thread.id data = { -- cgit v1.2.3 From dc1edf44be5593f9048f442a8aec68ae5250d953 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 14 Jun 2012 12:09:22 +0200 Subject: [IMP] project: implemented the privacy/visibility record rule in a cleaner way + some cleanup and bug fixing related to contract management bzr revid: qdp-launchpad@openerp.com-20120614100922-5g29ui88nhqojon2 --- addons/mail/mail_thread.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'addons/mail/mail_thread.py') diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index b1b6c68e4cc..5e025c4b5f8 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -68,9 +68,14 @@ class mail_thread(osv.osv): res[id] = self.message_load_ids(cr, uid, [id], context=context) return res + def _search_message_ids(self, cr, uid, obj, name, args, context=None): + msg_obj = self.pool.get('mail.message') + msg_ids = msg_obj.search(cr, uid, ['&', ('res_id', 'in', args[0][2]), ('model', '=', self._name)], context=context) + return [('id', 'in', msg_ids)] + # OpenChatter: message_ids is a dummy field that should not be used _columns = { - 'message_ids': fields.function(_get_message_ids, method=True, + 'message_ids': fields.function(_get_message_ids, method=True, fnct_search=_search_message_ids, type='one2many', obj='mail.message', string='Temp messages', _fields_id = 'res_id'), } -- cgit v1.2.3