I tried to get a specific product variant by TemplateID and attributeValueID with the follow codes:
attributeValueIds = models.execute_kw(db, uid, password, 'product.template.attribute.value', 'search', [[['product_tmpl_id', '=', product_template_id], ['product_attribute_value_id', '=', attribute_id]]], {'limit':1})
if len(attributeValueIds) >0:
attributeValueId = attributeValueIds[0]
...
set1 = models.execute_kw(db, uid, password, 'product.variant.combination', 'search_read', [[['product_template_attribute_value_id', '=', attributeValueId]]], {'field': ['product_product_id']})
And I got an error:
xmlrpc.client.Fault: product.variant.combination doesn't exist">
Is there anyone can help? Appreciate.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
1978
أدوات العرض
Just found that, the table "product_variant_combination" is a relational table for product.product and product.template.attribute.value. So no model named "product.variant.combination" at all.
Can I query the product varirants like this?
models.execute_kw(db, uid, password, 'product.product', 'search_read', [[['product_template_attribute_value_ids', 'in', [attributeValueId]]]])
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل