From 699d676de58daa9d27e3970a30a2beaa16cbde08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vanhaudenard?= Date: Tue, 11 May 2021 12:35:43 +0000 Subject: [PATCH] [FIX] expression: Better Binaries logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Raphael Collet (rco) --- odoo/osv/expression.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) # -------------------------------------------------