I get an exception when reading sale orders. The type not implemented is JTokenType.Object. The model is sale.order.
When I implement it, and return true, I can read the sale orders. But that is not a nice solution I'd say.
Can someone fix this? I don't have enough knowledge of the code to actually fix this properly.
Here is the stack trace:
System.Exception: Error CodeInternalServerError : Message - Internal Server Error : Content - System.Exception: System.Exception: Not implemented json mapping value: '$"tax_totals": {
"amount_untaxed": 0.0,
"amount_total": 0.0,
"formatted_amount_total": "0,00 €",
"formatted_amount_untaxed": "0,00 €",
"groups_by_subtotal": {},
"subtotals": [],
"subtotals_order": [],
"display_tax_base": false
}' to String
at PortaCapena.OdooJsonRpcClient.Converters.OdooModelMapper.ConverOdooPropertyToDotNet(Type dotnetType, JToken value, Object& result)
at PortaCapena.OdooJsonRpcClient.Converters.OdooModelConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at PortaCapena.OdooJsonRpcClient.OdooClient.CallAndDeserializeAsync[T](OdooRequestModel request, CancellationToken cancellationToken)
at CPFrames.Erp.Odoo.Sales.SalesFunctions.CreateSalesOrder(Int64 partnerId) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Erp.Odoo\Sales\SalesFunctions.cs:line 34
at CPFrames.Erp.Odoo.OdooErp.PublishQuote(IOrderDto order, IQuoteDto quote) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Erp.Odoo\OdooErp.cs:line 73
at CPFrames.Api.Backend.DataModel.Orders.OrdersActionEngine.PublishQuote(DataDocument document, String quoteId) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Api.Backend\DataModel\Orders\OrdersActionEngine.cs:line 174
at CPFrames.Api.Backend.DataModel.Orders.OrdersController.PublishQuote(DataDocument document, String dtoid) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Api.Backend\DataModel\Orders\OrdersController.cs:line 64
at lambda_method120(Closure, Object)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Hello,
I get an exception when reading sale orders. The type not implemented is JTokenType.Object. The model is sale.order.
When I implement it, and return true, I can read the sale orders. But that is not a nice solution I'd say. Can someone fix this? I don't have enough knowledge of the code to actually fix this properly.
Here is the stack trace:
System.Exception: Error CodeInternalServerError : Message - Internal Server Error : Content - System.Exception: System.Exception: Not implemented json mapping value: '$"tax_totals": { "amount_untaxed": 0.0, "amount_total": 0.0, "formatted_amount_total": "0,00 €", "formatted_amount_untaxed": "0,00 €", "groups_by_subtotal": {}, "subtotals": [], "subtotals_order": [], "display_tax_base": false }' to String at PortaCapena.OdooJsonRpcClient.Converters.OdooModelMapper.ConverOdooPropertyToDotNet(Type dotnetType, JToken value, Object& result) at PortaCapena.OdooJsonRpcClient.Converters.OdooModelConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value) at PortaCapena.OdooJsonRpcClient.OdooClient.CallAndDeserializeAsync[T](OdooRequestModel request, CancellationToken cancellationToken) at CPFrames.Erp.Odoo.Sales.SalesFunctions.CreateSalesOrder(Int64 partnerId) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Erp.Odoo\Sales\SalesFunctions.cs:line 34 at CPFrames.Erp.Odoo.OdooErp.PublishQuote(IOrderDto order, IQuoteDto quote) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Erp.Odoo\OdooErp.cs:line 73 at CPFrames.Api.Backend.DataModel.Orders.OrdersActionEngine.PublishQuote(DataDocument document, String quoteId) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Api.Backend\DataModel\Orders\OrdersActionEngine.cs:line 174 at CPFrames.Api.Backend.DataModel.Orders.OrdersController.PublishQuote(DataDocument document, String dtoid) in C:\Users\markk\Source\repos\CPFrames\src\CPFrames.Api.Backend\DataModel\Orders\OrdersController.cs:line 64 at lambda_method120(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)