From ce7e973e855389fe463ff9a1f9f29ac8f9f1bb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 15 Dec 2025 17:11:51 +0100 Subject: [PATCH] Log exception when retrieve file ID from the filestore for Binary field --- trytond/trytond/model/fields/binary.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/model/fields/binary.py b/trytond/trytond/model/fields/binary.py index 94919c0b69..b8c6db53ff 100644 --- a/trytond/trytond/model/fields/binary.py +++ b/trytond/trytond/model/fields/binary.py @@ -1,5 +1,8 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. + +import logging + from sql import Column, Null from trytond.filestore import filestore @@ -8,6 +11,8 @@ from trytond.transaction import Transaction from .field import Field +logger = logging.getLogger(__name__) + def caster(d): if isinstance(d, bytes): @@ -88,7 +93,9 @@ class Binary(Field): try: res[record_id] = store_func(file_id, prefix) except (IOError, OSError): - pass + logger.exception( + "failed to retrieve %r from filestore at %r", + file_id, prefix) for i in values: if i['id'] in res: