Skip to content

Read with multiple id's not working #112

Description

@Eriki419

Good afternoon!

I am doing a "read" command, because I already have a list of id's. As I understand it, I should not do a "search_read" then, because it results in two database calls. However, for the "read" the Odoo server actually expects a list of list of id's (only if there's more than one id). So it will throw an exception "BaseModel.read() got multiple values for argument 'fields'".

In short, I can not request
[12, 16]
but I should request
[[12, 16]]

The OdooRequestModel.Read() method expects a long[] for the id's and puts that straight into the requests, resulting in the error.

Complimentary to this, it would be nice if OdooClient has a ReadAsync() method for this.

Cheers! I'll put this in a PR if it makes sense.

Package version: 1.0.20

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions