brotherton-erpnext/erpnext/patches/v4_2/set_company_country.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
527 B
Python
Raw Normal View History

# 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
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:
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)