Merge pull request #17446 from netchampfaris/product-configurator-skip-disabled-items
fix: Skip disabled items in product configurator
This commit is contained in:
commit
64346c08c6
@ -66,11 +66,15 @@ class ItemVariantsCacheManager:
|
||||
as_list=1
|
||||
)
|
||||
|
||||
disabled_items = [i.name for i in frappe.db.get_all('Item', {'disabled': 1})]
|
||||
|
||||
attribute_value_item_map = frappe._dict({})
|
||||
item_attribute_value_map = frappe._dict({})
|
||||
|
||||
for row in item_variants_data:
|
||||
item_code, attribute, attribute_value = row
|
||||
if item_code in disabled_items:
|
||||
continue
|
||||
# (attr, value) => [item1, item2]
|
||||
attribute_value_item_map.setdefault((attribute, attribute_value), []).append(item_code)
|
||||
# item => {attr1: value1, attr2: value2}
|
||||
@ -96,7 +100,6 @@ class ItemVariantsCacheManager:
|
||||
|
||||
def build_cache(item_code):
|
||||
frappe.cache().hset('item_cache_build_in_progress', item_code, 1)
|
||||
print('ItemVariantsCacheManager: Building cache for', item_code)
|
||||
i = ItemVariantsCacheManager(item_code)
|
||||
i.build_cache()
|
||||
frappe.cache().hset('item_cache_build_in_progress', item_code, 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user