mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-30 07:08:24 +00:00
removed control panel
This commit is contained in:
@@ -332,8 +332,7 @@ class Company(Document):
|
||||
for d in acc_list_common:
|
||||
self.add_acc(d)
|
||||
|
||||
country = frappe.db.sql("select value from tabSingles where field = 'country' and doctype = 'Control Panel'")
|
||||
country = country and cstr(country[0][0]) or ''
|
||||
country = frappe.db.get_default("country")
|
||||
|
||||
# load taxes (only for India)
|
||||
if country == 'India':
|
||||
|
||||
@@ -29,7 +29,7 @@ class GlobalDefaults(Document):
|
||||
def on_update(self):
|
||||
"""update defaults"""
|
||||
self.validate_session_expiry()
|
||||
self.update_control_panel()
|
||||
self.set_country_and_timezone()
|
||||
|
||||
for key in keydict:
|
||||
frappe.db.set_default(key, self.get(keydict[key], ''))
|
||||
@@ -59,14 +59,9 @@ class GlobalDefaults(Document):
|
||||
frappe.msgprint("""Session Expiry must be in format hh:mm""",
|
||||
raise_exception=1)
|
||||
|
||||
def update_control_panel(self):
|
||||
cp_doc = frappe.get_doc("Control Panel")
|
||||
if self.country:
|
||||
cp_doc.country = self.country
|
||||
if self.time_zone:
|
||||
cp_doc.time_zone = self.time_zone
|
||||
cp_doc.ignore_permissions = True
|
||||
cp_doc.save()
|
||||
def set_country_and_timezone(self):
|
||||
frappe.db.set_default("country", self.country)
|
||||
frappe.db.set_default("time_zone", self.time_zone)
|
||||
|
||||
def get_defaults(self):
|
||||
return frappe.defaults.get_defaults()
|
||||
|
||||
Reference in New Issue
Block a user