OdooJsonRpcClient icon indicating copy to clipboard operation
OdooJsonRpcClient copied to clipboard

Error with repository.Query().ToListAsync on account.move with Odoo V17

Open JRB202 opened this issue 9 months ago • 0 comments

With this VB code you get an execution error with Odoo V17

Obviously, AccountMoveOdooModel have been pasted from GetDotNetModel result

Testing code :

    Dim tableName = "account.move"       
    Dim modelResult = Task.Run(Function() odooClient.GetModelAsync(tableName)).Result

    ' Get the model structure to copy and paste in code
    ' To convert C# to VB : https://converter.telerik.com/
    Dim modelResultClass = OdooModelMapper.GetDotNetModel(tableName, modelResult.Value)
    ' Model is well returned and contains "tax_totals"

    Dim repository = New OdooRepository(Of OdooClass.AccountMoveOdooModel)(config) 
    Dim AllRecordList = Task.Run(Function() repository.Query().ToListAsync()).Result

The error message is : System.Exception: Not implemented json mapping value: '$"tax_totals"

"tax_totals" is well declared in AccountMoveOdooModel with : <JsonProperty("tax_totals")> Public Property TaxTotals As String

But not this nasty '$"tax_totals" Note the strange $ char !

JRB202 avatar May 07 '24 10:05 JRB202