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
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
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]]]])
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden