[FIX] expression: Better Binaries logs
When building a domain `(=|!=)` with a Binary field stored in attachment and the right part of the domain is not null, the full binary content is logged, giving the logs a huge size. Now, the content of the binary is cropped to 20 chars as it is useless to log more. opw-2527629 closes odoo/odoo#70740 X-original-commit: 0ed46ae94b20b30c10025b2a458e1ecf92c2712d Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com> Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
@@ -117,6 +117,7 @@ import collections.abc
|
||||
import warnings
|
||||
|
||||
import logging
|
||||
import reprlib
|
||||
import traceback
|
||||
from functools import partial
|
||||
|
||||
@@ -875,7 +876,7 @@ class expression(object):
|
||||
push(('id', inselect_operator, (subselect, params)), model, alias, internal=True)
|
||||
else:
|
||||
_logger.error("Binary field '%s' stored in attachment: ignore %s %s %s",
|
||||
field.string, left, operator, right)
|
||||
field.string, left, operator, reprlib.repr(right))
|
||||
push(TRUE_LEAF, model, alias)
|
||||
|
||||
# -------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user