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