def invalidate_cache_for_item(doc): """Invalidate Item Group cache and rebuild ItemVariantsCacheManager.""" invalidate_cache_for(doc, doc.item_group) if doc.get( "old_item_group") and doc.get("old_item_group") != doc.item_group: invalidate_cache_for(doc, doc.old_item_group) invalidate_item_variants_cache_for_website(doc)
def invalidate_cache_for_web_item(doc): """Invalidate Website Item Group cache and rebuild ItemVariantsCacheManager.""" from erpnext.stock.doctype.item.item import invalidate_item_variants_cache_for_website invalidate_cache_for(doc, doc.item_group) website_item_groups = list( set((doc.get("old_website_item_groups") or []) + [ d.item_group for d in doc.get({"doctype": "Website Item Group"}) if d.item_group ])) for item_group in website_item_groups: invalidate_cache_for(doc, item_group) # Update Search Cache update_index_for_item(doc) invalidate_item_variants_cache_for_website(doc)
def invalidate_cache_for_item(doc): invalidate_cache_for(doc, doc.item_group) website_item_groups = list(set((doc.get("old_website_item_groups") or []) + [d.item_group for d in doc.get({"doctype":"Website Item Group"}) if d.item_group])) for item_group in website_item_groups: invalidate_cache_for(doc, item_group) if doc.get("old_item_group") and doc.get("old_item_group") != doc.item_group: invalidate_cache_for(doc, doc.old_item_group)
def invalidate_cache_for_item(doc): invalidate_cache_for(doc, doc.item_group) for d in doc.get({"doctype": "Website Item Group"}): invalidate_cache_for(doc, d.item_group)
def invalidate_cache_for_item(doc): invalidate_cache_for(doc, doc.item_group) for d in doc.get({"doctype":"Website Item Group"}): if d.item_group: invalidate_cache_for(doc, d.item_group)