Good morning everyone. I would like to ask if anyone knows how to update product attributes using the API, for example how to add a value to an attribute of an existing product that already has other values of the same type. Example: we have a product with "color" attribute with "red" value, I would like to add a new value to the attribute, for example "black". Right now when
I add the value it gives me an error: An XML-RPC fault occurred. Fault code: 2. Fault string: Color Value: Black not defined for Color attribute on product
this is the code.... :
variant_data = {
'name': 'Test',
'product_tmpl_id': template_id,
'product_template_attribute_value_ids': [(0, 0, {'attribute_id': attribute_id, 'product_attribute_value_id': value_id, 'attribute_line_id': attribute
}
new_variant_id = models.execute_kw(db, uid, password, 'product.product', 'create', [variant_data])