Odoo Help


Update a product field "Quantity On Hand" with xmlrpc

on 3/13/16, 5:36 AM 514 views

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.

On 3/13/16, 4:16 PM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/13/16, 5:36 AM
Seen: 514 times
Last updated: 3/13/16, 4:16 PM