def execute():
    reload_doctypes_for_schools_icons()

    frappe.reload_doc('website', 'doctype', 'portal_settings')
    frappe.reload_doc('website', 'doctype', 'portal_menu_item')
    frappe.reload_doc('buying', 'doctype', 'request_for_quotation')

    if 'schools' in frappe.get_installed_apps():
        frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
        frappe.db.sql("""delete from `tabDesktop Icon`""")
        if not frappe.db.exists('Module Def', 'Schools'):
            frappe.get_doc({
                'doctype': 'Module Def',
                'module_name': 'Schools',
                'app_name': 'erpnext'
            }).insert()
        frappe.db.sql(
            """update `tabDocType` set module='Schools' where module='Academics'"""
        )
        from frappe.installer import remove_from_installed_apps
        remove_from_installed_apps("schools")
        domainify.setup_domain('Education')
    else:
        frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
        domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
def remove_from_installed_apps(context, app):
	from frappe.installer import remove_from_installed_apps
	for site in context.sites:
		try:
			frappe.init(site=site)
			frappe.connect()
			remove_from_installed_apps(app)
		finally:
			frappe.destroy()
Example #3
0
def remove_from_installed_apps(context, app):
    from frappe.installer import remove_from_installed_apps
    for site in context.sites:
        try:
            frappe.init(site=site)
            frappe.connect()
            remove_from_installed_apps(app)
        finally:
            frappe.destroy()
Example #4
0
def remove_from_installed_apps(context, app):
    "Remove app from site's installed-apps list"
    from frappe.installer import remove_from_installed_apps
    for site in context.sites:
        try:
            frappe.init(site=site)
            frappe.connect()
            remove_from_installed_apps(app)
        finally:
            frappe.destroy()
    if not context.sites:
        raise SiteNotSpecifiedError
def execute():
	reload_doctypes_for_schools_icons()

	frappe.reload_doc('website', 'doctype', 'portal_settings')
	frappe.reload_doc('website', 'doctype', 'portal_menu_item')
	frappe.reload_doc('buying', 'doctype', 'request_for_quotation')

	if 'schools' in frappe.get_installed_apps():
		frappe.db.sql("""delete from `tabDesktop Icon`""")
		
		if not frappe.db.exists('Module Def', 'Schools') and frappe.db.exists('Module Def', 'Academics'):
			frappe.rename_doc("Module Def", "Academics", "Schools")
			
		remove_from_installed_apps("schools")
def execute():
    reload_doctypes_for_schools_icons()

    frappe.reload_doc('website', 'doctype', 'portal_settings')
    frappe.reload_doc('website', 'doctype', 'portal_menu_item')
    frappe.reload_doc('buying', 'doctype', 'request_for_quotation')

    if 'schools' in frappe.get_installed_apps():
        frappe.db.sql("""delete from `tabDesktop Icon`""")

        if not frappe.db.exists('Module Def', 'Schools') and frappe.db.exists(
                'Module Def', 'Academics'):
            frappe.rename_doc("Module Def", "Academics", "Schools")

        remove_from_installed_apps("schools")
def execute():
    reload_doctypes_for_schools_icons()

    frappe.reload_doc('website', 'doctype', 'portal_settings')
    frappe.reload_doc('website', 'doctype', 'portal_menu_item')
    frappe.reload_doc('buying', 'doctype', 'request_for_quotation')

    if 'schools' in frappe.get_installed_apps():
        if not frappe.db.exists('Module Def', 'Schools') and frappe.db.exists(
                'Module Def', 'Academics'):

            # 'Schools' module changed to the 'Education'
            # frappe.rename_doc("Module Def", "Academics", "Schools")

            frappe.rename_doc("Module Def", "Academics", "Education")

        remove_from_installed_apps("schools")
Example #8
0
def execute():
    if 'knowledge_base' in frappe.get_installed_apps():
        frappe.reload_doc('website', 'doctype', 'help_category')
        frappe.reload_doc('website', 'doctype', 'help_article')
        update_routes(['Help Category', 'Help Article'])
        remove_from_installed_apps('knowledge_base')

        # remove module def
        if frappe.db.exists('Module Def', 'Knowledge Base'):
            frappe.delete_doc('Module Def', 'Knowledge Base')

        # set missing routes
        for doctype in ('Help Category', 'Help Article'):
            for d in frappe.get_all(doctype, fields=['name', 'route']):
                if not d.route:
                    doc = frappe.get_doc(doctype, d.name)
                    doc.set_route()
                    doc.db_update()
def execute():
	reload_doctypes_for_schools_icons()

	frappe.reload_doc('website', 'doctype', 'portal_settings')
	frappe.reload_doc('website', 'doctype', 'portal_menu_item')
	frappe.reload_doc('buying', 'doctype', 'request_for_quotation')

	if 'schools' in frappe.get_installed_apps():
		frappe.db.sql("""delete from `tabDesktop Icon`""")
		if not frappe.db.exists('Module Def', 'Schools'):
			frappe.get_doc({
				'doctype': 'Module Def',
				'module_name': 'Schools',
				'app_name': 'erpnext'
			}).insert()
		frappe.db.sql("""update `tabDocType` set module='Schools' where module='Academics'""")
		from frappe.installer import remove_from_installed_apps
		remove_from_installed_apps("schools")
Example #10
0
def execute():
	frappe.reload_doc('erpbee_integrations', 'doctype', 'shopify_settings')
	frappe.reload_doc('erpbee_integrations', 'doctype', 'shopify_tax_account')
	frappe.reload_doc('erpbee_integrations', 'doctype', 'shopify_log')
	frappe.reload_doc('erpbee_integrations', 'doctype', 'shopify_webhook_detail')

	if 'erpbee_shopify' in frappe.get_installed_apps():
		remove_from_installed_apps('erpbee_shopify')

		frappe.delete_doc("Module Def", 'erpbee_shopify')

		frappe.db.commit()

		frappe.db.sql("truncate `tabShopify Log`")

		setup_app_type()
	else:
		disable_shopify()
Example #11
0
def execute():
    frappe.reload_doc("erpnext_integrations", "doctype", "shopify_settings")
    frappe.reload_doc("erpnext_integrations", "doctype", "shopify_tax_account")
    frappe.reload_doc("erpnext_integrations", "doctype", "shopify_log")
    frappe.reload_doc("erpnext_integrations", "doctype",
                      "shopify_webhook_detail")

    if "erpnext_shopify" in frappe.get_installed_apps():
        remove_from_installed_apps("erpnext_shopify")

        frappe.delete_doc("Module Def", "erpnext_shopify")

        frappe.db.commit()

        frappe.db.sql("truncate `tabShopify Log`")

        setup_app_type()
    else:
        disable_shopify()
def execute():
	frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_settings')
	frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_tax_account')
	frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_log')
	frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_webhook_detail')

	if 'erpnext_shopify' in frappe.get_installed_apps():
		remove_from_installed_apps('erpnext_shopify')

		frappe.db.sql('delete from `tabDesktop Icon` where app="erpnext_shopify" ')
		frappe.delete_doc("Module Def", 'erpnext_shopify')

		frappe.db.commit()

		frappe.db.sql("truncate `tabShopify Log`")

		setup_app_type()
	else:
		disable_shopify()
Example #13
0
def execute():
	if 'knowledge_base' in frappe.get_installed_apps():
		frappe.reload_doc('website', 'doctype', 'help_category')
		frappe.reload_doc('website', 'doctype', 'help_article')
		update_routes(['Help Category', 'Help Article'])
		remove_from_installed_apps('knowledge_base')

		# remove desktop icon
		desktop_icon_name = frappe.db.get_value('Desktop Icon',
			dict(module_name='Knowledge Base', type='module'))
		if desktop_icon_name:
			frappe.delete_doc('Desktop Icon', desktop_icon_name)

		# remove module def
		if frappe.db.exists('Module Def', 'Knowledge Base'):
			frappe.delete_doc('Module Def', 'Knowledge Base')

		# set missing routes
		for doctype in ('Help Category', 'Help Article'):
			for d in frappe.get_all(doctype, fields=['name', 'route']):
				if not d.route:
					doc = frappe.get_doc(doctype, d.name)
					doc.set_route()
					doc.db_update()
def execute():
    from frappe.installer import remove_from_installed_apps
    remove_from_installed_apps("shopping_cart")
def uninstall_app(app_name):
    from frappe.installer import remove_from_installed_apps
    remove_from_installed_apps(app_name)
def uninstall_app(app_name):
	from frappe.installer import remove_from_installed_apps
	remove_from_installed_apps(app_name)
Example #17
0
def remove_from_installed_apps(*apps):
	from frappe.installer import remove_from_installed_apps
	frappe.connect()
	for app in apps:
		remove_from_installed_apps(app)
	frappe.destroy()
def execute():
	from frappe.installer import remove_from_installed_apps
	remove_from_installed_apps("shopping_cart")