[FIX] calendar: invalidate cache to avoid (pre)fetching invalid virtual IDs

Because the new API basically browses everything, the virtual IDs used by
calendar.event are added to the cache and prefetching tries to get them from
the database resulting in conversion errors. These ids have to be forcibly
evicted to avoid the error.
This commit is contained in:
Xavier Morel 2014-07-14 15:41:40 +02:00
parent 3491b7de34
commit a1de79b875
1 changed files with 6 additions and 0 deletions

View File

@ -1567,6 +1567,12 @@ class calendar_event(osv.Model):
select = [ids]
else:
select = ids
# FIXME: find a better way to not push virtual ids in the cache
# (leading to their prefetching and ultimately a type error when
# postgres tries to convert '14-3489274297' to an integer)
self.invalidate_cache(cr, uid, context=context)
select = map(lambda x: (x, calendar_id2real_id(x)), select)
result = []
real_data = super(calendar_event, self).read(cr, uid, [real_id for calendar_id, real_id in select], fields=fields2, context=context, load=load)