Website route for item based on name not item name (#8682)

This commit is contained in:
KanchanChauhan 2017-05-05 11:56:55 +05:30 committed by Nabin Hait
parent 6b3bc8a8e1
commit ed56b8afd8

View File

@ -142,7 +142,7 @@ class Item(WebsiteGenerator):
def make_route(self): def make_route(self):
if not self.route: if not self.route:
return cstr(frappe.db.get_value('Item Group', self.item_group, 'route')) + '/' + self.scrub(self.item_name) return cstr(frappe.db.get_value('Item Group', self.item_group, 'route')) + '/' + self.scrub(self.name)
def get_parents(self, context): def get_parents(self, context):
item_group, route = frappe.db.get_value('Item Group', self.item_group, ['name', 'route']) item_group, route = frappe.db.get_value('Item Group', self.item_group, ['name', 'route'])