parent
fa09719fbf
commit
9fcea67fab
|
@ -429,6 +429,7 @@ class one2many(_column):
|
||||||
for act in values:
|
for act in values:
|
||||||
if act[0] == 0:
|
if act[0] == 0:
|
||||||
act[2][self._fields_id] = id
|
act[2][self._fields_id] = id
|
||||||
|
print 'CREATE', self._obj, act[2], context
|
||||||
obj.create(cr, user, act[2], context=context)
|
obj.create(cr, user, act[2], context=context)
|
||||||
elif act[0] == 1:
|
elif act[0] == 1:
|
||||||
obj.write(cr, user, [act[1]], act[2], context=context)
|
obj.write(cr, user, [act[1]], act[2], context=context)
|
||||||
|
|
|
@ -116,7 +116,7 @@ class browse_record(object):
|
||||||
'''
|
'''
|
||||||
if not context:
|
if not context:
|
||||||
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._list_class = list_class or browse_record_list
|
||||||
self._cr = cr
|
self._cr = cr
|
||||||
self._uid = uid
|
self._uid = uid
|
||||||
|
@ -128,9 +128,12 @@ class browse_record(object):
|
||||||
|
|
||||||
cache.setdefault(table._name, {})
|
cache.setdefault(table._name, {})
|
||||||
self._data = cache[table._name]
|
self._data = cache[table._name]
|
||||||
|
|
||||||
if not id in self._data:
|
if not id in self._data:
|
||||||
self._data[id] = {'id': id}
|
self._data[id] = {'id': id}
|
||||||
|
|
||||||
self._cache = cache
|
self._cache = cache
|
||||||
|
pass
|
||||||
|
|
||||||
def __getitem__(self, name):
|
def __getitem__(self, name):
|
||||||
if name == 'id':
|
if name == 'id':
|
||||||
|
@ -183,7 +186,7 @@ class browse_record(object):
|
||||||
if data[n]:
|
if data[n]:
|
||||||
obj = self._table.pool.get(f._obj)
|
obj = self._table.pool.get(f._obj)
|
||||||
compids = False
|
compids = False
|
||||||
if not f._classic_write:
|
if type(data[n]) in (type([]),type( (1,) )):
|
||||||
ids2 = data[n][0]
|
ids2 = data[n][0]
|
||||||
else:
|
else:
|
||||||
ids2 = data[n]
|
ids2 = data[n]
|
||||||
|
|
Loading…
Reference in New Issue