[FIX] fields : Use of defaultdict removed
bzr revid: jvo@tinyerp.com-20101013150040-r26sek4x6049u9l7
This commit is contained in:
parent
0664e7e05f
commit
2cfe39726e
|
@ -31,7 +31,6 @@
|
|||
# required
|
||||
# size
|
||||
#
|
||||
from collections import defaultdict
|
||||
import datetime as DT
|
||||
import string
|
||||
import netsvc
|
||||
|
@ -453,12 +452,14 @@ class one2many(_column):
|
|||
if not values:
|
||||
values = {}
|
||||
|
||||
res = defaultdict(list)
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = []
|
||||
|
||||
ids2 = obj.pool.get(self._obj).search(cr, user, self._domain + [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
|
||||
for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
|
||||
# if r[self._fields_id] in res.values():
|
||||
res[r[self._fields_id]].append(r['id'])
|
||||
if r[self._fields_id] in res.values():
|
||||
res[r[self._fields_id]].append(r['id'])
|
||||
return res
|
||||
|
||||
def set(self, cr, obj, id, field, values, user=None, context=None):
|
||||
|
|
Loading…
Reference in New Issue