Raise non processed exceptions when they occur during load of records
It is needed to not bypass catch_error decorator. Closes #13332 (grafted from 29a29ab9be793e2eaaee24b93c7871cd2897a3f9) --HG-- branch : 7.0
This commit is contained in:
1 parent
f8af341d8c
commit
b6aedebbfa
1 file changed
+9
-8
@@ -132,21 +132,22 @@ class Record:
|
||||
ctx.update(dict(('%s.%s' % (self.model_name, fname), 'size')
|
||||
for fname, field in self.group.fields.items()
|
||||
if field.attrs['type'] == 'binary' and fname in fnames))
|
||||
exception = False
|
||||
try:
|
||||
values = RPCExecute('model', self.model_name, 'read',
|
||||
list(id2record.keys()), fnames, context=ctx,
|
||||
process_exception=process_exception)
|
||||
except RPCException:
|
||||
values = [{'id': x} for x in id2record]
|
||||
default_values = dict((f, None) for f in fnames)
|
||||
for value in values:
|
||||
value.update(default_values)
|
||||
self.exception = exception = True
|
||||
for record in id2record.values():
|
||||
record.exception = True
|
||||
if process_exception:
|
||||
values = [{'id': x} for x in id2record]
|
||||
default_values = dict((f, None) for f in fnames)
|
||||
for value in values:
|
||||
value.update(default_values)
|
||||
else:
|
||||
raise
|
||||
id2value = dict((value['id'], value) for value in values)
|
||||
for id, record in id2record.items():
|
||||
if not record.exception:
|
||||
record.exception = exception
|
||||
value = id2value.get(id)
|
||||
if record and not record.destroyed and value:
|
||||
for key in record.modified_fields:
|
||||
|
||||
Reference in new issue
Block a user