summaryrefslogtreecommitdiff
path: root/odoo/osv/expression.py
diff options
context:
space:
mode:
authorJérôme Vanhaudenard <jev@odoo.com>2021-05-11 12:35:43 +0000
committerJérôme Vanhaudenard <jev@odoo.com>2021-05-12 06:48:59 +0000
commit0ed46ae94b20b30c10025b2a458e1ecf92c2712d (patch)
treeb94ff1aa00499028830da967aed0ea8c9cf66ef1 /odoo/osv/expression.py
parent2c6e744ba04e4b9a34a0f5f2e278fa046128754b (diff)
[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#70699 X-original-commit: d54b30bb7feed52de86f4302dc4a01f2d4009782 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com> Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/osv/expression.py')
-rw-r--r--odoo/osv/expression.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/osv/expression.py b/odoo/osv/expression.py
index ab4b546fa16..ce819013d02 100644
--- a/odoo/osv/expression.py
+++ b/odoo/osv/expression.py
@@ -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)
# -------------------------------------------------