chore: Redisearch module load tracking

This commit is contained in:
Hussain Nagaria
2021-05-26 22:43:22 +05:30
parent 9499db8cd9
commit 50d7989e50
2 changed files with 9 additions and 8 deletions

View File

@@ -46,11 +46,11 @@
"shop_by_category_section",
"slideshow",
"item_search_settings_section",
"redisearch_warning",
"search_index_fields",
"show_categories_in_search_autocomplete",
"show_brand_line",
"is_redisearch_loaded",
"redisearch"
"is_redisearch_loaded"
],
"fields": [
{
@@ -339,17 +339,17 @@
"label": "Is Redisearch Loaded"
},
{
"depends_on": "eval:doc.is_search_module_loaded",
"fieldname": "redisearch",
"depends_on": "eval:!doc.is_redisearch_loaded",
"fieldname": "redisearch_warning",
"fieldtype": "Heading",
"label": "Redisearch",
"options": "Some heading"
"label": "Redisearch Warning",
"options": "Redisearch is not loaded. Please install the redisearch module to enable more robust search features."
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-05-26 20:00:35.399936",
"modified": "2021-05-26 22:41:34.400589",
"modified_by": "Administrator",
"module": "E-commerce",
"name": "E Commerce Settings",

View File

@@ -8,13 +8,14 @@ from frappe.utils import cint, comma_and
from frappe import _, msgprint
from frappe.model.document import Document
from frappe.utils import get_datetime, get_datetime_str, now_datetime, unique
from erpnext.e_commerce.website_item_indexing import create_website_items_index, ALLOWED_INDEXABLE_FIELDS_SET
from erpnext.e_commerce.website_item_indexing import create_website_items_index, ALLOWED_INDEXABLE_FIELDS_SET, is_search_module_loaded
class ShoppingCartSetupError(frappe.ValidationError): pass
class ECommerceSettings(Document):
def onload(self):
self.get("__onload").quotation_series = frappe.get_meta("Quotation").get_options("naming_series")
self.is_redisearch_loaded = is_search_module_loaded()
def validate(self):
if self.home_page_is_products: