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:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
1504
Views
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]]]])
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up