Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2771 Vues

Hello.


I'm trying to update stocks using XMLRPC but I can't, and I don't know where can't be the problem.


The product type is "product" (to be stockable) and, when I create the sentence to create the stock for the product, in the product profile don't appear.


For example:

Note: I made the project with PHP

1.- This is the array to create the stock for the product

$stock = [

            'product_id' => 13,

            'location_id' => 1,

            'new_quantity' => 50,

        ];


2.- I pass this array to the function to create the stock in the table 'stock.change.product.qty'

$idStock = XML_RPC::CallMethod($this->data['oobj'], 'execute_kw', ['database', 'user', 'pass', 'stock.change.product.qty', 'create', [$stock]]);


And $idStock is (for example) number 2, so, the query works. But, in the product I can't see the stock, appears 0 in "on hand" and "Forecasted"


Where can be the problem?

Avatar
Ignorer
Auteur Meilleure réponse

Problem solved!

The location_id was wrong, I had to put the id of 'stock' (14).

Can close the thread. Thanks!

Avatar
Ignorer
Publications associées Réponses Vues Activité
2
sept. 20
2771
3
août 24
1963
0
août 21
2121
2
mars 15
8383
3
juil. 25
1850