diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 22d56953e62..34a348c5b25 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -994,7 +994,6 @@ class calendar_event(osv.Model): sort_fields[ord] = '%s-%s' % (browse_event[ord], r_date.strftime("%Y%m%d%H%M%S")) else: sort_fields[ord] = browse_event[ord] - 'If we sort on FK, we obtain a browse_record, so we need to sort on name_get' if type(browse_event[ord]) is openerp.osv.orm.browse_record: name_get = browse_event[ord].name_get() if len(name_get) and len(name_get[0]) >= 2: @@ -1401,7 +1400,8 @@ class calendar_event(osv.Model): for arg in args: if arg[0] == 'id': for n, calendar_id in enumerate(arg[2]): - arg[2][n] = calendar_id.split('-')[0] + if isinstance(calendar_id, str): + arg[2][n] = calendar_id.split('-')[0] return super(calendar_event, self)._name_search(cr, user, name=name, args=args, operator=operator, context=context, limit=limit, name_get_uid=name_get_uid) def write(self, cr, uid, ids, values, context=None):