diff --git a/frappe/commands.py b/frappe/commands.py index ee1c8ae522..2639ef0e08 100644 --- a/frappe/commands.py +++ b/frappe/commands.py @@ -349,12 +349,14 @@ def reset_perms(context): frappe.destroy() @click.command('execute') +@click.argument('method') @pass_context -def execute(context): +def execute(context, method): "execute a function" for site in context.sites: try: frappe.init(site=site) + frappe.connect() ret = frappe.get_attr(method)() if frappe.db: diff --git a/frappe/config/desktop.py b/frappe/config/desktop.py index c9aac32d60..70b73ffb7e 100644 --- a/frappe/config/desktop.py +++ b/frappe/config/desktop.py @@ -52,7 +52,7 @@ def get_data(): "type": "module" }, "Installer": { - "color": "#888", + "color": "#5ac8fb", "icon": "icon-download", "icon": "octicon octicon-cloud-download", "link": "applications", diff --git a/frappe/model/utils.py b/frappe/model/utils.py index f5a8b533d8..907fcc932b 100644 --- a/frappe/model/utils.py +++ b/frappe/model/utils.py @@ -1,5 +1,5 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt +# MIT License. See license.txt from __future__ import unicode_literals import frappe, json @@ -9,9 +9,10 @@ Model utilities, unclassified functions """ def set_default(doc, key): + """Set is_default property of given doc and unset all others filtered by given key.""" if not doc.is_default: frappe.db.set(doc, "is_default", 1) - + frappe.db.sql("""update `tab%s` set `is_default`=0 - where `%s`=%s and name!=%s""" % (doc.doctype, key, "%s", "%s"), + where `%s`=%s and name!=%s""" % (doc.doctype, key, "%s", "%s"), (doc.get(key), doc.name)) diff --git a/frappe/utils/bench_helper.py b/frappe/utils/bench_helper.py index b633f60aa3..01f08adaac 100644 --- a/frappe/utils/bench_helper.py +++ b/frappe/utils/bench_helper.py @@ -14,7 +14,7 @@ def main(): def get_app_groups(): ret = {} - for app in get_apps(): + for app in ["frappe"]: #get_apps(): app_group = get_app_group(app) if app_group: ret[app] = app_group @@ -55,7 +55,7 @@ def get_app_commands(app): app_command_module = importlib.import_module(app + '.commands') except ImportError: return [] - + ret = {} for command in getattr(app_command_module, 'commands', []): ret[command.name] = command