From 62b73408a12bf146bb58f335ef3c6b167e69e556 Mon Sep 17 00:00:00 2001 From: zolokonst Date: Thu, 27 Jun 2024 15:47:32 +0400 Subject: [PATCH] Update OdooModelMapper.cs Issue like " Not implemented json mapping value: '$"sale_delay": 0' to Nullable`1" fixed. (Conversion from double added) --- PortaCapena.OdooJsonRpcClient/Converters/OdooModelMapper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PortaCapena.OdooJsonRpcClient/Converters/OdooModelMapper.cs b/PortaCapena.OdooJsonRpcClient/Converters/OdooModelMapper.cs index 1d22ca6..badbc66 100644 --- a/PortaCapena.OdooJsonRpcClient/Converters/OdooModelMapper.cs +++ b/PortaCapena.OdooJsonRpcClient/Converters/OdooModelMapper.cs @@ -36,6 +36,7 @@ public static bool ConverOdooPropertyToDotNet(Type dotnetType, JToken value, out return true; case JTokenType.Integer when dotnetType == typeof(int) || dotnetType == typeof(int?) || dotnetType == typeof(long) || dotnetType == typeof(long?): + case JTokenType.Integer when dotnetType == typeof(float)|| dotnetType == typeof(float?) || dotnetType == typeof(double) || dotnetType == typeof(double?): case JTokenType.Float: result = value.ToObject(dotnetType); return true; @@ -255,4 +256,4 @@ public static string GetOdooEnumName(FieldInfo fieldInfo) throw new ArgumentException($"Missing atrribute: '{nameof(EnumMemberAttribute)}' for enum '{fieldInfo.FieldType.Name}' - '{fieldInfo.Name}'"); } } -} \ No newline at end of file +}