rename sitemap to route

This commit is contained in:
Rushabh Mehta 2014-02-25 11:08:18 +05:30
parent a1c96de9fc
commit a6628eee56
7 changed files with 27 additions and 15 deletions

View File

@ -20,3 +20,4 @@ execute:frappe.reload_doc('support', 'doctype', 'newsletter') # 2014-01-31
execute:frappe.reload_doc('hr', 'doctype', 'employee') # 2014-02-03 execute:frappe.reload_doc('hr', 'doctype', 'employee') # 2014-02-03
execute:frappe.conn.sql("update tabPage set module='Core' where name='Setup'") execute:frappe.conn.sql("update tabPage set module='Core' where name='Setup'")
erpnext.patches.4_0.fields_to_be_renamed erpnext.patches.4_0.fields_to_be_renamed
erpnext.patches.4_0.rename_sitemap_to_route

View File

@ -0,0 +1,11 @@
import frappe
import frappe.model
def execute():
frappe.reload_doc("stock", "doctype", "item_group")
frappe.reload_doc("stock", "doctype", "item")
frappe.reload_doc("setup", "doctype", "sales_partner")
frappe.model.rename_field("Item Group", "parent_website_sitemap", "parent_website_route")
frappe.model.rename_field("Item", "parent_website_sitemap", "parent_website_route")
frappe.model.rename_field("Sales Partner", "parent_website_sitemap",
"parent_website_route")

View File

@ -13,8 +13,8 @@ class DocType(DocTypeNestedSet):
self.nsm_parent_field = 'parent_item_group' self.nsm_parent_field = 'parent_item_group'
def validate(self): def validate(self):
if not self.doc.parent_website_sitemap: if not self.doc.parent_website_route:
self.doc.parent_website_sitemap = frappe.get_website_sitemap("Item Group", self.doc.parent_website_route = frappe.get_website_route("Item Group",
self.doc.parent_item_group) self.doc.parent_item_group)
def on_update(self): def on_update(self):

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-03-28 10:35:29", "creation": "2013-03-28 10:35:29",
"docstatus": 0, "docstatus": 0,
"modified": "2014-02-20 18:29:56", "modified": "2014-02-20 18:29:57",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -116,10 +116,10 @@
{ {
"depends_on": "show_in_website", "depends_on": "show_in_website",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "parent_website_sitemap", "fieldname": "parent_website_route",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Parent Website Page", "label": "Parent Website Page",
"options": "Website Sitemap" "options": "Website Route"
}, },
{ {
"depends_on": "show_in_website", "depends_on": "show_in_website",

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-04-12 15:34:06", "creation": "2013-04-12 15:34:06",
"docstatus": 0, "docstatus": 0,
"modified": "2014-02-20 18:30:31", "modified": "2014-02-20 18:30:32",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -224,10 +224,10 @@
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "parent_website_sitemap", "fieldname": "parent_website_route",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Parent Website Sitemap", "label": "Parent Website Route",
"options": "Website Sitemap" "options": "Website Route"
}, },
{ {
"create": 0, "create": 0,

View File

@ -42,8 +42,8 @@ class DocType(DocListController):
self.cant_change() self.cant_change()
self.validate_item_type_for_reorder() self.validate_item_type_for_reorder()
if not self.doc.parent_website_sitemap: if not self.doc.parent_website_route:
self.doc.parent_website_sitemap = frappe.get_website_sitemap("Item Group", self.doc.item_group) self.doc.parent_website_route = frappe.get_website_route("Item Group", self.doc.item_group)
if self.doc.name: if self.doc.name:
self.old_page_name = frappe.conn.get_value('Item', self.doc.name, 'page_name') self.old_page_name = frappe.conn.get_value('Item', self.doc.name, 'page_name')

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-05-03 10:45:46", "creation": "2013-05-03 10:45:46",
"docstatus": 0, "docstatus": 0,
"modified": "2014-02-20 18:27:01", "modified": "2014-02-20 18:27:02",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -850,10 +850,10 @@
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "parent_website_sitemap", "fieldname": "parent_website_route",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Parent Website Sitemap", "label": "Parent Website Route",
"options": "Website Sitemap" "options": "Website Route"
}, },
{ {
"create": 1, "create": 1,