def update_routes(doctypes):
 for d in doctypes:
  frappe.reload_doctype(d)
  c = get_controller(d)
  condition = ''
  if c.website.condition_field:
   condition = 'where {0}=1'.format(c.website.condition_field)
  try:
   frappe.db.sql('update ignore `tab{0}` set route = concat(ifnull(parent_website_route, ""),\n DCTB  DCTB  DCTB  DCTB if(ifnull(parent_website_route, "")="", "", "/"), page_name) {1}'.format(d, condition))
  except Exception as e:
   if (e.args[0] != 1054):
    raise

def update_routes ( doctypes ) : for d in doctypes : frappe . reload_doctype ( d ) c = get_controller ( d ) condition = '' if c . website . condition_field : condition = 'where {0}=1' . format ( c . website . condition_field ) try : frappe . db . sql ( 'update ignore `tab{0}` set route = concat(ifnull(parent_website_route, ""),\n DCTB  DCTB  DCTB  DCTB if(ifnull(parent_website_route, "")="", "", "/"), page_name) {1}' . format ( d , condition ) ) except Exception as e : if ( e . args [ 0 ] != 1054 ) : raise
patch old routing system .