seitime-frappe/frappe/migrate.py
Shivam Mishra d3b4a165f2 feat: [v10] Deprecate In App Help (#6834)
* [feat] Removed help from global search

* [feat] redirected search in help to docs website

[] Url needs to be configurable from hooks

* [Feat] Removed search functions for help

* [fix] Help links not redirecting

* [feat] Modified "Help" menu on desk toolbar

* [feat] Removed docs search from desk toolbar

* Removed Search from toolbar.js

* Removed help from migrate

* Deprecated help from command utils

* Removed help setup from travis.yml

* [fix] Fixed formatting issues

* [fix] Deleted commented code from toolbar.js

* [fix] Minor link fix

* [fix] Removed accidentally added autodeploy
2019-01-28 12:20:24 +05:30

52 lines
1.4 KiB
Python

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.translate
import frappe.modules.patch_handler
import frappe.model.sync
from frappe.utils.fixtures import sync_fixtures
from frappe.sessions import clear_global_cache
from frappe.desk.notifications import clear_notifications
from frappe.website import render, router
from frappe.desk.doctype.desktop_icon.desktop_icon import sync_desktop_icons
from frappe.core.doctype.language.language import sync_languages
from frappe.modules.utils import sync_customizations
def migrate(verbose=True, rebuild_website=False):
'''Migrate all apps to the latest version, will:
- run patches
- sync doctypes (schema)
- sync fixtures
- sync desktop icons
- sync web pages (from /www)'''
frappe.flags.in_migrate = True
clear_global_cache()
# run patches
frappe.modules.patch_handler.run_all()
# sync
frappe.model.sync.sync_all(verbose=verbose)
frappe.translate.clear_cache()
sync_fixtures()
sync_customizations()
sync_desktop_icons()
sync_languages()
frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
# syncs statics
render.clear_cache()
# add static pages to global search
router.sync_global_search()
frappe.db.commit()
clear_notifications()
frappe.publish_realtime("version-update")
frappe.flags.in_migrate = False