[fix] typo, item group route to have parent only for non root
This commit is contained in:
parent
958b06b129
commit
17e6bb83eb
@ -36,7 +36,7 @@ $.extend(shopping_cart, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
update_cart: function(opts) {
|
update_cart: function(opts) {
|
||||||
if(fraappe.session.user==="Guest") {
|
if(frappe.session.user==="Guest") {
|
||||||
if(localStorage) {
|
if(localStorage) {
|
||||||
localStorage.setItem("last_visited", window.location.pathname);
|
localStorage.setItem("last_visited", window.location.pathname);
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,11 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
|||||||
if not self.route:
|
if not self.route:
|
||||||
self.route = ''
|
self.route = ''
|
||||||
if self.parent_item_group:
|
if self.parent_item_group:
|
||||||
parent_route = frappe.get_doc('Item Group', self.parent_item_group).route
|
parent_item_group = frappe.get_doc('Item Group', self.parent_item_group)
|
||||||
|
|
||||||
if parent_route:
|
# make parent route only if not root
|
||||||
self.route = parent_route + '/'
|
if parent_item_group.parent_item_group and parent_item_group.route:
|
||||||
|
self.route = parent_item_group.route + '/'
|
||||||
|
|
||||||
self.route += self.scrub(self.item_group_name)
|
self.route += self.scrub(self.item_group_name)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user