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
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
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]]]])
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się