From 7e51d98553bfd910e8dabbcd890857b4bf1f4cd0 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 26 Apr 2016 14:55:41 +0200 Subject: [PATCH] [FIX] calendar: correct search on mail.message and ir.attachment Handle the case of immutable (tuple) domain leafs. --- addons/calendar/calendar.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 427f515ffd0..5da9104b6a8 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1759,9 +1759,10 @@ class mail_message(osv.Model): ''' convert the search on real ids in the case it was asked on virtual ids, then call super() ''' + args = list(args) for index in range(len(args)): if args[index][0] == "res_id" and isinstance(args[index][2], basestring): - args[index][2] = get_real_ids(args[index][2]) + args[index] = (args[index][0], args[index][1], get_real_ids(args[index][2])) return super(mail_message, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count) def _find_allowed_model_wise(self, cr, uid, doc_model, doc_dict, context=None): @@ -1781,9 +1782,10 @@ class ir_attachment(osv.Model): ''' convert the search on real ids in the case it was asked on virtual ids, then call super() ''' + args = list(args) for index in range(len(args)): if args[index][0] == "res_id" and isinstance(args[index][2], basestring): - args[index][2] = get_real_ids(args[index][2]) + args[index] = (args[index][0], args[index][1], get_real_ids(args[index][2])) return super(ir_attachment, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count) def write(self, cr, uid, ids, vals, context=None):