fix: Sider and indexing (minor)
diff --git a/erpnext/e_commerce/doctype/website_item/website_item.py b/erpnext/e_commerce/doctype/website_item/website_item.py
index 51983ff..53ed5e8 100644
--- a/erpnext/e_commerce/doctype/website_item/website_item.py
+++ b/erpnext/e_commerce/doctype/website_item/website_item.py
@@ -8,7 +8,6 @@
import itertools
from frappe import _
-from frappe.website.render import clear_cache
from frappe.website.website_generator import WebsiteGenerator
from frappe.utils import cstr, random_string, cint, flt
@@ -359,3 +358,7 @@
website_item.save()
return [website_item.name, website_item.web_item_name]
+
+def on_doctype_update():
+ # since route is a Text column, it needs a length for indexing
+ frappe.db.add_index("Website Item", ["route(500)"])
\ No newline at end of file
diff --git a/erpnext/portal/doctype/homepage/homepage.js b/erpnext/portal/doctype/homepage/homepage.js
index ea34bb1..59f808a 100644
--- a/erpnext/portal/doctype/homepage/homepage.js
+++ b/erpnext/portal/doctype/homepage/homepage.js
@@ -3,7 +3,7 @@
frappe.ui.form.on('Homepage', {
setup: function(frm) {
- frm.fields_dict["products"].grid.get_field("item").get_query = function(){
+ frm.fields_dict["products"].grid.get_field("item").get_query = function() {
return {
filters: {'published': 1}
}
@@ -21,9 +21,9 @@
});
frappe.ui.form.on('Homepage Featured Product', {
- view: function(frm, cdt, cdn){
- var child= locals[cdt][cdn]
- if(child.item_code && child.route){
+ view: function(frm, cdt, cdn) {
+ var child= locals[cdt][cdn];
+ if (child.item_code && child.route) {
window.open('/' + child.route, '_blank');
}
}
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 59bb7a0..ebc3276 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -408,7 +408,6 @@
if self.published_in_website:
invalidate_cache_for_item(self)
- clear_cache(self.route)
frappe.db.set_value("Item", new_name, "item_code", new_name)
@@ -998,10 +997,6 @@
if publish_progress:
frappe.publish_progress(count / total * 100, title=_("Updating Variants..."))
-def on_doctype_update():
- # since route is a Text column, it needs a length for indexing
- frappe.db.add_index("Item", ["route(500)"])
-
@erpnext.allow_regional
def set_item_tax_from_hsn_code(item):
pass