Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
Update Quantity on Hand via XMLRPC and PHP odoo V14

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

   $change_id = $models->execute_kw($db, $uid, $password,
        'stock.change.product.qty', 'create',
        array(array(
            'product_id'=>11745,
            'location_id'=>15,
            'new_quantity'=>26,
            )
        ));
        $models->execute_kw($db, $uid, $password, 'stock.change.product.qty', 'change_product_qty', [$change_id]);

But it doesn't work. How can I fix it?

enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

For changing stock quantity for products you need to create a stock.quant record.

   $models->execute_kw($db, $uid, $password,
        'stock.quant', 'create',
        array(array(
            'product_id'=>11745,
            'location_id'=>15,
            'inventory_quantity'=>26,
            )
        ));

Also keep in mind that directly changing the stock quantity is not recommended, it should be changed from a purchase order or a sale order or from production or inventory adjustments based on the situation.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda