brotherton-erpnext/erpnext/patches/v4_0/rename_sitemap_to_route.py
cclauss 6848708377 old style exception, raise --> new style for Python 3 (#10082)
* old style raise --> raise() for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style exception --> new style for Python 3

* old style raise --> raise() for Python 3

* old style raise --> raise() for Python 3

* old style exception, raise --> new style for Python 3
2017-07-27 10:38:35 +05:30

18 lines
586 B
Python

from __future__ import unicode_literals
import frappe
import frappe.model
def execute():
frappe.reload_doc("setup", "doctype", "item_group")
frappe.reload_doc("stock", "doctype", "item")
frappe.reload_doc("setup", "doctype", "sales_partner")
try:
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")
except Exception as e:
if e.args[0]!=1054:
raise