Skip to content

Commit

Permalink
Update OdooModelMapper.cs
Browse files Browse the repository at this point in the history
 Issue like
" Not implemented json mapping value: '$"sale_delay": 0' to Nullable`1"
fixed. (Conversion from double added)
  • Loading branch information
zolokonst authored Jun 27, 2024
1 parent 46ab08e commit 62b7340
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PortaCapena.OdooJsonRpcClient/Converters/OdooModelMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -255,4 +256,4 @@ public static string GetOdooEnumName(FieldInfo fieldInfo)
throw new ArgumentException($"Missing atrribute: '{nameof(EnumMemberAttribute)}' for enum '{fieldInfo.FieldType.Name}' - '{fieldInfo.Name}'");
}
}
}
}

0 comments on commit 62b7340

Please sign in to comment.