25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
400 B

  1. import frappe
  2. def execute():
  3. update_routes(['Blog Post', 'Blog Category', 'Web Page'])
  4. def update_routes(doctypes):
  5. """Patch old routing system"""
  6. for d in doctypes:
  7. try:
  8. frappe.db.sql("""update `tab{0}` set route = concat(ifnull(parent_website_route, ""),
  9. if(ifnull(parent_website_route, "")="", "", "/"), page_name)""".format(d))
  10. except Exception, e:
  11. if e.args[0]!=1054: raise e