refactor: Cache Item Reviews and other review feedback

- `get_doc` -> `get_values` and `db.sql` -> `db.delete` in Wishlist Item deletion
- cache first page of Item Reviews and burst cache on addition and deletion of reviews
- Update redisearch docs link in E Commerce Settings
- Removed unused cint import
- Broke setting attribute context into smaller functions and code cleanup
- Minor recommended items padding tweak
- Item reviews form dict now uses website item as key
- Customer reviews rendered from UI style consistency
- Stock status consistency in listing and full page
- Handle no price in variant dialog for matched item
This commit is contained in:
marination
2021-08-25 13:09:35 +05:30
parent 9aeb211142
commit 6b2b9dcee2
14 changed files with 218 additions and 129 deletions

View File

@@ -139,7 +139,7 @@ def get_non_stock_item_status(item_code, item_warehouse_field):
# if item is a product bundle, check if its bundle items are in stock
if frappe.db.exists("Product Bundle", item_code):
items = frappe.get_doc("Product Bundle", item_code).get_all_children()
bundle_warehouse = frappe.db.get_value('Item', item_code, item_warehouse_field)
return all([get_web_item_qty_in_stock(d.item_code, item_warehouse_field, bundle_warehouse).in_stock for d in items])
bundle_warehouse = frappe.db.get_value("Website Item", {"item_code": item_code}, item_warehouse_field)
return all(get_web_item_qty_in_stock(d.item_code, item_warehouse_field, bundle_warehouse).in_stock for d in items)
else:
return 1