From 750bfe204583ae53c085b7b1a91a6475a0c7590f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Jul 2025 23:10:30 +0200 Subject: [PATCH] Do not convert integer value from binary function field Binary fields can have two types bytes and integer when only the size is requested. So integer value should not be converted to bytes. Closes #14100 --- trytond/trytond/model/fields/function.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/model/fields/function.py b/trytond/trytond/model/fields/function.py index 135b991007..78dc7f4f6a 100644 --- a/trytond/trytond/model/fields/function.py +++ b/trytond/trytond/model/fields/function.py @@ -158,7 +158,10 @@ class Function(Field): elif (field._py_type and value is not None and not isinstance(value, field._py_type)): - value = field._py_type(value) + if field._type == 'binary' and isinstance(value, int): + pass + else: + value = field._py_type(value) return value def convert_dict(values, name):