Merge pull request #2154 from anandpdoshi/anand-september-5

Setup Wizard: set corrected number format in system settings
This commit is contained in:
Nabin Hait 2014-09-08 14:23:07 +05:30
commit 34b94aff73

View File

@ -171,19 +171,26 @@ def set_defaults(args):
global_defaults.save()
number_format = get_country_info(args.get("country")).get("number_format", "#,###.##")
# replace these as float number formats, as they have 0 precision
# and are currency number formats and not for floats
if number_format=="#.###":
number_format = "#.###,##"
elif number_format=="#,###":
number_format = "#,###.##"
system_settings = frappe.get_doc("System Settings", "System Settings")
system_settings.update({
"language": args.get("language"),
"time_zone": args.get("timezone"),
"float_precision": 3,
'date_format': frappe.db.get_value("Country", args.get("country"), "date_format"),
'number_format': get_country_info(args.get("country")).get("number_format", "#,###.##"),
'number_format': number_format,
'enable_scheduler': 1
})
system_settings.save()
accounts_settings = frappe.get_doc("Accounts Settings")
accounts_settings.auto_accounting_for_stock = 1
accounts_settings.save()