[FIX] Calendar - only try to split the virtual id if it's a string

bzr revid: jke@openerp.com-20140424121118-t5rgqssf7mnr6bax
This commit is contained in:
Kersten Jeremy 2014-04-24 14:11:18 +02:00
parent f73907587b
commit 7994fe09a3
1 changed files with 2 additions and 2 deletions

View File

@ -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):