Exemple #1
0
 def get_apps(self):
     from frappe.utils.change_log import get_versions
     apps = get_versions()
     out = []
     for app, values in apps.items():
         out.append({'name': app, 'title': values['title']})
     return out
Exemple #2
0
def get_bootinfo():
	"""build and return boot info"""
	frappe.set_user_lang(frappe.session.user)
	bootinfo = frappe._dict()
	hooks = frappe.get_hooks()
	doclist = []

	# user
	get_user(bootinfo)

	# system info
	bootinfo['sysdefaults'] = frappe.defaults.get_defaults()
	bootinfo['server_date'] = frappe.utils.nowdate()

	if frappe.session['user'] != 'Guest':
		bootinfo['user_info'] = get_fullnames()
		bootinfo['sid'] = frappe.session['sid'];

	# home page
	bootinfo.modules = {}
	for app in frappe.get_installed_apps():
		try:
			bootinfo.modules.update(frappe.get_attr(app + ".config.desktop.get_data")() or {})
		except ImportError:
			pass
		except AttributeError:
			pass

	bootinfo.module_app = frappe.local.module_app
	bootinfo.hidden_modules = frappe.db.get_global("hidden_modules")
	bootinfo.doctype_icons = dict(frappe.db.sql("""select name, icon from
		tabDocType where ifnull(icon,'')!=''"""))
	bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType where ifnull(issingle,0)=1""")
	add_home_page(bootinfo, doclist)
	bootinfo.page_info = get_allowed_pages()
	load_translations(bootinfo)
	add_timezone_info(bootinfo)
	load_conf_settings(bootinfo)
	load_print(bootinfo, doclist)
	doclist.extend(get_meta_bundle("Page"))
	bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1})

	# ipinfo
	if frappe.session['data'].get('ipinfo'):
		bootinfo['ipinfo'] = frappe.session['data']['ipinfo']

	# add docs
	bootinfo['docs'] = doclist

	for method in hooks.boot_session or []:
		frappe.get_attr(method)(bootinfo)

	if bootinfo.lang:
		bootinfo.lang = unicode(bootinfo.lang)
	bootinfo['versions'] = {k: v['version'] for k, v in get_versions().items()}

	bootinfo.error_report_email = frappe.get_hooks("error_report_email")
	bootinfo.calendars = sorted(frappe.get_hooks("calendars"))

	return bootinfo
Exemple #3
0
def get_bootinfo():
    """build and return boot info"""
    frappe.set_user_lang(frappe.session.user)
    bootinfo = frappe._dict()
    hooks = frappe.get_hooks()
    doclist = []

    # user
    get_user(bootinfo)

    # system info
    bootinfo.sysdefaults = frappe.defaults.get_defaults()
    bootinfo.server_date = frappe.utils.nowdate()

    if frappe.session['user'] != 'Guest':
        bootinfo.user_info = get_fullnames()
        bootinfo.sid = frappe.session['sid']

    bootinfo.modules = {}
    bootinfo.module_list = []
    load_desktop_icons(bootinfo)
    bootinfo.letter_heads = get_letter_heads()
    bootinfo.active_domains = frappe.get_active_domains()
    bootinfo.all_domains = [d.get("name") for d in frappe.get_all("Domain")]

    bootinfo.module_app = frappe.local.module_app
    bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType
		where issingle=1""")
    add_home_page(bootinfo, doclist)
    bootinfo.page_info = get_allowed_pages()
    load_translations(bootinfo)
    add_timezone_info(bootinfo)
    load_conf_settings(bootinfo)
    load_print(bootinfo, doclist)
    doclist.extend(get_meta_bundle("Page"))
    bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1})

    # ipinfo
    if frappe.session.data.get('ipinfo'):
        bootinfo.ipinfo = frappe.session['data']['ipinfo']

    # add docs
    bootinfo.docs = doclist

    for method in hooks.boot_session or []:
        frappe.get_attr(method)(bootinfo)

    if bootinfo.lang:
        bootinfo.lang = unicode(bootinfo.lang)
    bootinfo.versions = {k: v['version'] for k, v in get_versions().items()}

    bootinfo.error_report_email = frappe.get_hooks("error_report_email")
    bootinfo.calendars = sorted(frappe.get_hooks("calendars"))
    bootinfo.treeviews = frappe.get_hooks("treeviews") or []
    bootinfo.lang_dict = get_lang_dict()
    bootinfo.feedback_triggers = get_enabled_feedback_trigger()
    bootinfo.gsuite_enabled = get_gsuite_status()
    bootinfo.update(get_email_accounts(user=frappe.session.user))

    return bootinfo
Exemple #4
0
	def set_version(self):
		if self.versions:
			return
		version = ""
		space = "\n"
		for key,value in get_versions().items():
			version = version + value["title"] + " " + value["branch"]+" "+value["version"] + space
		self.versions = version
Exemple #5
0
def get_bootinfo():
	"""build and return boot info"""
	frappe.set_user_lang(frappe.session.user)
	bootinfo = frappe._dict()
	hooks = frappe.get_hooks()
	doclist = []

	# user
	get_user(bootinfo)

	# system info
	bootinfo.sysdefaults = frappe.defaults.get_defaults()
	bootinfo.server_date = frappe.utils.nowdate()

	if frappe.session['user'] != 'Guest':
		bootinfo.user_info = get_fullnames()
		bootinfo.sid = frappe.session['sid'];

	bootinfo.modules = {}
	bootinfo.module_list = []
	load_desktop_icons(bootinfo)

	bootinfo.module_app = frappe.local.module_app
	bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType
		where issingle=1""")
	add_home_page(bootinfo, doclist)
	bootinfo.page_info = get_allowed_pages()
	load_translations(bootinfo)
	add_timezone_info(bootinfo)
	load_conf_settings(bootinfo)
	load_print(bootinfo, doclist)
	doclist.extend(get_meta_bundle("Page"))
	bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1})

	# ipinfo
	if frappe.session.data.get('ipinfo'):
		bootinfo.ipinfo = frappe.session['data']['ipinfo']

	# add docs
	bootinfo.docs = doclist

	for method in hooks.boot_session or []:
		frappe.get_attr(method)(bootinfo)

	if bootinfo.lang:
		bootinfo.lang = unicode(bootinfo.lang)
	bootinfo.versions = {k: v['version'] for k, v in get_versions().items()}

	bootinfo.error_report_email = frappe.get_hooks("error_report_email")
	bootinfo.calendars = sorted(frappe.get_hooks("calendars"))
	bootinfo.treeviews = frappe.get_hooks("treeviews") or []
	bootinfo.email_accounts = frappe.get_all('User Emails', fields=['email_account', 'email_id'],
		filters=dict(parent=frappe.session.user), order_by='idx')
	bootinfo.lang_dict = get_lang_dict()

	return bootinfo
Exemple #6
0
def check_branch_compatibility_with_frappe():
	from frappe.utils.change_log import get_versions
	versions = get_versions()
	frappe_branch = versions["frappe"]["branch"]
	erpnext_branch = versions["erpnext"]["branch"]

	if frappe_branch in ("hotfix", "master") and erpnext_branch == "develop":
		raise frappe.IncompatibleApp("Frappe is on branch: {} and ERPNext is on branch: {}".format(frappe_branch, erpnext_branch))
	if erpnext_branch in ("hotfix", "master") and frappe_branch == "develop":
		raise frappe.IncompatibleApp("Frappe is on branch: {} and ERPNext is on branch: {}".format(frappe_branch, erpnext_branch))
Exemple #7
0
def get_installed_apps_info():
	out = []
	from frappe.utils.change_log import get_versions

	for app, version_details in iteritems(get_versions()):
		out.append({
			'app_name': app,
			'version': version_details.get('branch_version') or version_details.get('version'),
			'branch': version_details.get('branch')
		})

	return out
Exemple #8
0
def get_bootinfo():
    """build and return boot info"""
    frappe.set_user_lang(frappe.session.user)
    bootinfo = frappe._dict()
    hooks = frappe.get_hooks()
    doclist = []

    # user
    get_user(bootinfo)

    # system info
    bootinfo['sysdefaults'] = frappe.defaults.get_defaults()
    bootinfo['server_date'] = frappe.utils.nowdate()

    if frappe.session['user'] != 'Guest':
        bootinfo['user_info'] = get_fullnames()
        bootinfo['sid'] = frappe.session['sid']

    bootinfo.modules = {}
    bootinfo.module_list = []
    load_desktop_icons(bootinfo)

    bootinfo.module_app = frappe.local.module_app
    bootinfo.single_types = frappe.db.sql_list(
        """select name from tabDocType where issingle=1""")
    add_home_page(bootinfo, doclist)
    bootinfo.page_info = get_allowed_pages()
    load_translations(bootinfo)
    add_timezone_info(bootinfo)
    load_conf_settings(bootinfo)
    load_print(bootinfo, doclist)
    doclist.extend(get_meta_bundle("Page"))
    bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1})

    # ipinfo
    if frappe.session['data'].get('ipinfo'):
        bootinfo['ipinfo'] = frappe.session['data']['ipinfo']

    # add docs
    bootinfo['docs'] = doclist

    for method in hooks.boot_session or []:
        frappe.get_attr(method)(bootinfo)

    if bootinfo.lang:
        bootinfo.lang = unicode(bootinfo.lang)
    bootinfo['versions'] = {k: v['version'] for k, v in get_versions().items()}

    bootinfo.error_report_email = frappe.get_hooks("error_report_email")
    bootinfo.calendars = sorted(frappe.get_hooks("calendars"))
    bootinfo["lang_dict"] = get_lang_dict()

    return bootinfo
Exemple #9
0
def get_installed_apps_info():
	out = []
	from frappe.utils.change_log import get_versions

	for app, version_details in iteritems(get_versions()):
		out.append({
			'app_name': app,
			'version': version_details.get('branch_version') or version_details.get('version'),
			'branch': version_details.get('branch')
		})

	return out
Exemple #10
0
def get_installed_apps_info():
	out = []
	from frappe.utils.change_log import get_versions

	for app, version_details in get_versions().items():
		out.append(
			{
				"app_name": app,
				"version": version_details.get("branch_version") or version_details.get("version"),
				"branch": version_details.get("branch"),
			}
		)

	return out
Exemple #11
0
def get_bootinfo():
    """build and return boot info"""
    frappe.set_user_lang(frappe.session.user)
    bootinfo = frappe._dict()
    hooks = frappe.get_hooks()
    doclist = []

    # user
    get_user(bootinfo)

    # system info
    bootinfo.sitename = frappe.local.site
    bootinfo.sysdefaults = frappe.defaults.get_defaults()
    bootinfo.server_date = frappe.utils.nowdate()

    if frappe.session['user'] != 'Guest':
        bootinfo.user_info = get_user_info()
        bootinfo.sid = frappe.session['sid']

    bootinfo.modules = {}
    bootinfo.module_list = []
    load_desktop_data(bootinfo)
    bootinfo.letter_heads = get_letter_heads()
    bootinfo.active_domains = frappe.get_active_domains()
    bootinfo.all_domains = [d.get("name") for d in frappe.get_all("Domain")]
    add_layouts(bootinfo)

    bootinfo.module_app = frappe.local.module_app
    bootinfo.single_types = [
        d.name for d in frappe.get_all('DocType', {'issingle': 1})
    ]
    bootinfo.nested_set_doctypes = [
        d.parent
        for d in frappe.get_all('DocField', {'fieldname': 'lft'}, ['parent'])
    ]
    add_home_page(bootinfo, doclist)
    bootinfo.page_info = get_allowed_pages()
    load_translations(bootinfo)
    add_timezone_info(bootinfo)
    load_conf_settings(bootinfo)
    load_print(bootinfo, doclist)
    doclist.extend(get_meta_bundle("Page"))
    bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1})
    bootinfo.navbar_settings = get_navbar_settings()
    bootinfo.notification_settings = get_notification_settings()

    # ipinfo
    if frappe.session.data.get('ipinfo'):
        bootinfo.ipinfo = frappe.session['data']['ipinfo']

    # add docs
    bootinfo.docs = doclist

    for method in hooks.boot_session or []:
        frappe.get_attr(method)(bootinfo)

    if bootinfo.lang:
        bootinfo.lang = text_type(bootinfo.lang)
    bootinfo.versions = {k: v['version'] for k, v in get_versions().items()}

    bootinfo.error_report_email = frappe.conf.error_report_email
    bootinfo.calendars = sorted(frappe.get_hooks("calendars"))
    bootinfo.treeviews = frappe.get_hooks("treeviews") or []
    bootinfo.lang_dict = get_lang_dict()
    bootinfo.success_action = get_success_action()
    bootinfo.update(get_email_accounts(user=frappe.session.user))
    bootinfo.energy_points_enabled = is_energy_point_enabled()
    bootinfo.website_tracking_enabled = is_tracking_enabled()
    bootinfo.points = get_energy_points(frappe.session.user)
    bootinfo.frequently_visited_links = frequently_visited_links()
    bootinfo.link_preview_doctypes = get_link_preview_doctypes()
    bootinfo.additional_filters_config = get_additional_filters_from_hooks()
    bootinfo.desk_settings = get_desk_settings()
    bootinfo.app_logo_url = get_app_logo()

    return bootinfo
Exemple #12
0
def get_bootinfo():
    """build and return boot info"""
    frappe.set_user_lang(frappe.session.user)
    bootinfo = frappe._dict()
    hooks = frappe.get_hooks()
    doclist = []

    # user
    get_user(bootinfo)

    # system info
    bootinfo["sysdefaults"] = frappe.defaults.get_defaults()
    bootinfo["server_date"] = frappe.utils.nowdate()

    if frappe.session["user"] != "Guest":
        bootinfo["user_info"] = get_fullnames()
        bootinfo["sid"] = frappe.session["sid"]

        # home page
    bootinfo.modules = {}
    for app in frappe.get_installed_apps():
        try:
            bootinfo.modules.update(frappe.get_attr(app + ".config.desktop.get_data")() or {})
        except ImportError:
            pass
        except AttributeError:
            pass

    bootinfo.module_app = frappe.local.module_app
    bootinfo.hidden_modules = frappe.db.get_global("hidden_modules")
    bootinfo.doctype_icons = dict(
        frappe.db.sql(
            """select name, icon from
		tabDocType where ifnull(icon,'')!=''"""
        )
    )
    bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType where ifnull(issingle,0)=1""")
    add_home_page(bootinfo, doclist)
    bootinfo.page_info = get_allowed_pages()
    load_translations(bootinfo)
    add_timezone_info(bootinfo)
    load_conf_settings(bootinfo)
    load_print(bootinfo, doclist)
    doclist.extend(get_meta_bundle("Page"))

    # ipinfo
    if frappe.session["data"].get("ipinfo"):
        bootinfo["ipinfo"] = frappe.session["data"]["ipinfo"]

        # add docs
    bootinfo["docs"] = doclist

    for method in hooks.boot_session or []:
        frappe.get_attr(method)(bootinfo)

    if bootinfo.lang:
        bootinfo.lang = unicode(bootinfo.lang)
    bootinfo["versions"] = {k: v["version"] for k, v in get_versions().items()}

    bootinfo.error_report_email = frappe.get_hooks("error_report_email")
    bootinfo.default_background_image = get_url("/assets/frappe/images/ui/into-the-dawn.jpg")
    bootinfo.calendars = sorted(frappe.get_hooks("calendars"))

    return bootinfo
Exemple #13
0
def get_version():
    version = ""
    space = "\n"
    for key,value in get_versions().items():
        version = version + value["title"] + " " + value["branch"]+" "+value["version"] + space
    return version
Exemple #14
0
def get_bootinfo():
	"""build and return boot info"""
	frappe.set_user_lang(frappe.session.user)
	bootinfo = frappe._dict()
	hooks = frappe.get_hooks()
	doclist = []

	# user
	get_user(bootinfo)

	# system info
	bootinfo.sitename = frappe.local.site
	bootinfo.sysdefaults = frappe.defaults.get_defaults()
	bootinfo.user_permissions = get_user_permissions()
	bootinfo.server_date = frappe.utils.nowdate()

	if frappe.session['user'] != 'Guest':
		bootinfo.user_info = get_fullnames()
		bootinfo.sid = frappe.session['sid'];

	bootinfo.modules = {}
	bootinfo.module_list = []
	load_desktop_icons(bootinfo)
	bootinfo.letter_heads = get_letter_heads()
	bootinfo.active_domains = frappe.get_active_domains()
	bootinfo.all_domains = [d.get("name") for d in frappe.get_all("Domain")]

	bootinfo.module_app = frappe.local.module_app
	bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType
		where issingle=1""")
	add_home_page(bootinfo, doclist)
	bootinfo.page_info = get_allowed_pages()
	load_translations(bootinfo)
	add_timezone_info(bootinfo)
	load_conf_settings(bootinfo)
	load_print(bootinfo, doclist)
	doclist.extend(get_meta_bundle("Page"))
	bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1})

	# ipinfo
	if frappe.session.data.get('ipinfo'):
		bootinfo.ipinfo = frappe.session['data']['ipinfo']

	# add docs
	bootinfo.docs = doclist

	for method in hooks.boot_session or []:
		frappe.get_attr(method)(bootinfo)

	if bootinfo.lang:
		bootinfo.lang = text_type(bootinfo.lang)
	bootinfo.versions = {k: v['version'] for k, v in get_versions().items()}

	bootinfo.error_report_email = frappe.get_hooks("error_report_email")
	bootinfo.calendars = sorted(frappe.get_hooks("calendars"))
	bootinfo.treeviews = frappe.get_hooks("treeviews") or []
	bootinfo.lang_dict = get_lang_dict()
	bootinfo.feedback_triggers = get_enabled_feedback_trigger()
	bootinfo.gsuite_enabled = get_gsuite_status()
	bootinfo.update(get_email_accounts(user=frappe.session.user))

	return bootinfo
Exemple #15
0
def get_versions():
    from frappe.utils.change_log import get_versions
    return get_versions()