Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4140 Lượt xem

I am trying to update some information on my odoo product with PHP and xmlrpc.

This is my code for update product name.

$models->execute_kw($db, $uid, $password, 'product.product', 'write',

array(array(5), array('name'=>"Newer product 3",'type'=>"consu")));

Now I want to change a "Quantity On Hand" field so I trying this code :

$models->execute_kw($db, $uid, $password, 'product.product', 'write',

array(array(5), array('name'=>"Newer product 3",'type'=>"consu",'qty_available'=>'7')));

but it doesn't work, anyone got any ideas how to fix it?

Thank you.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

It is not working because qty_available field is a functional field so it is automatically computed and you can't put values into it.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 18
4241
0
thg 5 16
7507
4
thg 12 15
4694
3
thg 3 15
6576
2
thg 3 15
10437