Use case does not matter so much as the issue is the same everywhere: getting specific attribute value of a given item and finding item(s) that match specific attribute values seems to be overly complicated in ERPNext in comparison to other ERPs. Now i see that the challenge was also described 2 years ago: Python Query of Item by Attributes (get_all on child table values) - #6 by batonac
Has something changed since then? In this thread I asked about a solution that would ideally look like that:
attribute_value = frappe.get_attribute_value(item_code, attribute_name)
but I am also interested in use cases presented by author in that thread:
item = frappe.get_all(‘Item’, filters={
‘variant_of’: ‘Grand Teton’,
‘attributes’: {“Width - ft”: 12, “Length - ft”: 12, “Bents”: 2}
})
It seems like a really basic functionality for which most of developers will need to create own custom helper functions if they do not exist natively. But maybe something has changed in last two years?
One potential bypass that I am considering is to add custom fields to every item representing every attribute. So e.g. fields attribute_size and attribute_color that can be used in get_all. But it feels non-Pythonic.
Any ideas would be much appreciated.