From 4865eabee5152d43f4b827d1ec03a2cf050b4705 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Wed, 24 Jul 2019 13:37:54 +0530 Subject: [PATCH] fix: add Company by default in session defaults (#18460) --- erpnext/setup/install.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 03da833dec..5e85f7d526 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -22,6 +22,7 @@ def after_install(): add_all_roles_to("Administrator") create_default_cash_flow_mapper_templates() create_default_success_action() + add_company_to_session_defaults() frappe.db.commit() @@ -84,3 +85,10 @@ def create_default_success_action(): if not frappe.db.exists('Success Action', success_action.get("ref_doctype")): doc = frappe.get_doc(success_action) doc.insert(ignore_permissions=True) + +def add_company_to_session_defaults(): + settings = frappe.get_single("Session Default Settings") + settings.append("session_defaults", { + "ref_doctype": "Company" + }) + settings.save()