feat: (minor) Backorder indicator and fixed inconsistencies

- Checkbox in website item to indicate if item is on backorder
- Indicator on listing on full page if availbale on backorder.
- fix: Allow provision to add any valid field from Website Item in Search Index
- fix: Settings filter fields are as per Item, make as per Website Item
- "Add to quote/ Go to Quote" if cart checkout is disabled
This commit is contained in:
marination
2021-09-02 14:07:59 +05:30
parent 45f64bd930
commit bbcbcf7a20
11 changed files with 129 additions and 59 deletions

View File

@@ -26,9 +26,11 @@ class ProductQuery:
self.or_filters = []
self.filters = [["published", "=", 1]]
self.fields = ['web_item_name', 'name', 'item_name', 'item_code', 'website_image',
'variant_of', 'has_variants', 'item_group', 'image', 'web_long_description',
'short_description', 'route', 'website_warehouse', 'ranking']
self.fields = [
"web_item_name", "name", "item_name", "item_code", "website_image",
"variant_of", "has_variants", "item_group", "image", "web_long_description",
"short_description", "route", "website_warehouse", "ranking", "on_backorder"
]
def query(self, attributes=None, fields=None, search_term=None, start=0, item_group=None):
"""
@@ -239,6 +241,9 @@ class ProductQuery:
warehouse = item.get("website_warehouse")
is_stock_item = frappe.get_cached_value("Item", item.item_code, "is_stock_item")
if item.get("on_backorder"):
return
if not is_stock_item:
if warehouse:
# product bundle case