@frappe.whitelist()
def update_column_order(board_name, order):
 board = frappe.get_doc(u'Kanban Board', board_name)
 order = json.loads(order)
 old_columns = board.columns
 new_columns = []
 for col in order:
  for column in old_columns:
   if (col == column.column_name):
    new_columns.append(column)
    old_columns.remove(column)
 new_columns.extend(old_columns)
 board.columns = []
 for col in new_columns:
  board.append(u'columns', dict(column_name=col.column_name, status=col.status, order=col.order, indicator=col.indicator))
 board.save()
 return board

@ frappe . whitelist ( ) def update_column_order ( board_name , order ) : board = frappe . get_doc ( u'Kanban Board' , board_name ) order = json . loads ( order ) old_columns = board . columns new_columns = [ ] for col in order : for column in old_columns : if ( col == column . column_name ) : new_columns . append ( column ) old_columns . remove ( column ) new_columns . extend ( old_columns ) board . columns = [ ] for col in new_columns : board . append ( u'columns' , dict ( column_name = col . column_name , status = col . status , order = col . order , indicator = col . indicator ) ) board . save ( ) return board
set the order of columns in kanban board .