brotherton-erpnext/erpnext/patches/v4_2/set_company_country.py
Aditya Hase 6ccb6562f1 Python 3 compatibility syntax error fixes (#10519)
* Use Python 3 style print function

* Use 'Exception as e' instead of 'Exception, e'

* Unpack tuple arguments explicitly in instead of relying on auto unpacking

* Use consistent indentation

* Use 0 if stock_frozen_upto_days is None
2017-08-28 18:17:36 +05:30

16 lines
527 B
Python

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
def execute():
country = frappe.db.get_single_value("Global Defaults", "country")
if not country:
print("Country not specified in Global Defaults")
return
for company in frappe.db.sql_list("""select name from `tabCompany`
where ifnull(country, '')=''"""):
frappe.db.set_value("Company", company, "country", country)