تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1099 أدوات العرض

I am using this code to use the XMLRPC API to add stock to my inventory:

quant_id = models.execute_kw(database, uid, apikey, 'stock.quant', 'search', [[ ('product_id', '=', product_id), ('location_id', '=', location_id)]])


if quant_id:

models.execute_kw(database, uid, apikey, 'stock.quant', 'write', [quant_id, {'quantity': newstocklevel}])

else:

models.execute_kw(database, uid, apikey, 'stock.quant', 'create', [{ 'product_id': product_id,'location_id': location_id,'quantity': newstocklevel}])

But this results in this error:


xmlrpc.client.Fault: <Fault 2: 'Hoeveelheden kunnen niet worden aangemaakt voor verbruiksartikelen of diensten.'>

Translated: quantities cannot be created for consumables or services

All my products are of type "goods" though.

 

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Please enable track inventory inside the Product view. 

This checkbox determines whether Odoo tracks inventory for this product.


Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 25
247
0
أغسطس 25
319
1
أغسطس 25
714
1
أغسطس 25
549
4
يوليو 25
1942