bzr revid: fp@tinyerp.com-20081121181224-ms1h2p3nip6w93kx
This commit is contained in:
Fabien Pinckaers 2008-11-21 19:12:24 +01:00
parent fa09719fbf
commit 9fcea67fab
2 changed files with 6 additions and 2 deletions

View File

@ -429,6 +429,7 @@ class one2many(_column):
for act in values:
if act[0] == 0:
act[2][self._fields_id] = id
print 'CREATE', self._obj, act[2], context
obj.create(cr, user, act[2], context=context)
elif act[0] == 1:
obj.write(cr, user, [act[1]], act[2], context=context)

View File

@ -116,7 +116,7 @@ class browse_record(object):
'''
if not context:
context = {}
assert id, _('Wrong ID for the browse record, got %s, expected an integer.') % str(id)
assert id and type(id)==type(1), _('Wrong ID for the browse record, got %s, expected an integer.') % str(id)
self._list_class = list_class or browse_record_list
self._cr = cr
self._uid = uid
@ -128,9 +128,12 @@ class browse_record(object):
cache.setdefault(table._name, {})
self._data = cache[table._name]
if not id in self._data:
self._data[id] = {'id': id}
self._cache = cache
pass
def __getitem__(self, name):
if name == 'id':
@ -183,7 +186,7 @@ class browse_record(object):
if data[n]:
obj = self._table.pool.get(f._obj)
compids = False
if not f._classic_write:
if type(data[n]) in (type([]),type( (1,) )):
ids2 = data[n][0]
else:
ids2 = data[n]