[IMP] core: readable representation of the cache

When the cache is filled with binary field, it can fill the logs with
unreadable and (probably) non compressible data

closes odoo/odoo#130741

X-original-commit: 6afba8fafe79dcf9bc28710a7edbd33b6a5b459f
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
This commit is contained in:
Stanislas Sobieski
2023-08-04 13:42:07 +02:00
parent 103583192b
commit 436503e1f4
+2 -2
View File
@@ -905,14 +905,14 @@ class Cache(object):
if field_cache and isinstance(next(iter(field_cache)), tuple):
data[field] = {
key: {
Starred(id_) if id_ in dirty_ids else id_: val
Starred(id_) if id_ in dirty_ids else id_: val if field.type != 'binary' else '<binary>'
for id_, val in key_cache.items()
}
for key, key_cache in field_cache.items()
}
else:
data[field] = {
Starred(id_) if id_ in dirty_ids else id_: val
Starred(id_) if id_ in dirty_ids else id_: val if field.type != 'binary' else '<binary>'
for id_, val in field_cache.items()
}
return repr(data)