2015-03-03 09:25:30 +00:00
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2014-09-01 04:53:47 +00:00
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
2017-08-28 12:47:36 +00:00
|
|
|
from __future__ import print_function, unicode_literals
|
2014-09-01 04:53:47 +00:00
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
country = frappe.db.get_single_value("Global Defaults", "country")
|
|
|
|
if not country:
|
2017-08-28 12:47:36 +00:00
|
|
|
print("Country not specified in Global Defaults")
|
2014-09-01 04:53:47 +00:00
|
|
|
return
|
|
|
|
|
|
|
|
for company in frappe.db.sql_list("""select name from `tabCompany`
|
|
|
|
where ifnull(country, '')=''"""):
|
|
|
|
frappe.db.set_value("Company", company, "country", country)
|