Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read on array of int doesn't work #6

Closed
jsayer101 opened this issue Nov 25, 2020 · 2 comments
Closed

Read on array of int doesn't work #6

jsayer101 opened this issue Nov 25, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jsayer101
Copy link
Contributor

Hi !

I'm trying to read on multiple ids to get a result for each ids :

This code throw an RequestException:

$client->read('stock.move', $myarray, ['fields' => ['product_id']]);

I've got the same problem on any other models & any other arrays

I've tried to use array_values but it doesn't work.

It works with only one id.

#0 C:\laragon\www\api-prod\vendor\ang3\php-odoo-api-client\src\Client.php(336): Ang3\Component\Odoo\Endpoint->call('execute_kw', Array)
#1 C:\laragon\www\api-prod\vendor\ang3\php-odoo-api-client\src\Client.php(143): Ang3\Component\Odoo\Client->call('stock.move', 'read', Array, Array)

Do you have any idea ?

So I'm actually iterating over the array of int and getting one by one the results.. But it takes so much long time this way.

Thanks

@Ang3
Copy link
Owner

Ang3 commented Nov 25, 2020

Hi,

Thank you for this feedback. Indeed, Odoo expects a value of type array<array<int>> but the client was just casting your array as array... I fixed the client in version v6.1.3. You just have to update the package via composer. ;)

Tested with values of type int and array<int>.

Thanks.

@Ang3 Ang3 added the bug Something isn't working label Nov 25, 2020
@Ang3 Ang3 self-assigned this Nov 25, 2020
@jsayer101
Copy link
Contributor Author

Thanks for the fast fix, it works great 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants