콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2806 화면

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?

아바타
취소
작성자 베스트 답변

Problem solved!

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

Can close the thread. Thanks!

아바타
취소
관련 게시물 답글 화면 활동
2
9월 20
2780
3
8월 24
1976
0
8월 21
2129
2
3월 15
8393
3
7월 25
1874