Merge pull request #2129 from anandpdoshi/anand-september-1
[patch] Set company's country
This commit is contained in:
commit
4f1bccb53d
@ -78,3 +78,4 @@ erpnext.patches.v4_2.update_project_milestones
|
|||||||
erpnext.patches.v4_2.add_currency_turkish_lira #2014-08-08
|
erpnext.patches.v4_2.add_currency_turkish_lira #2014-08-08
|
||||||
execute:frappe.delete_doc("DocType", "Landed Cost Wizard")
|
execute:frappe.delete_doc("DocType", "Landed Cost Wizard")
|
||||||
erpnext.patches.v4_2.default_website_style
|
erpnext.patches.v4_2.default_website_style
|
||||||
|
erpnext.patches.v4_2.set_company_country
|
||||||
|
15
erpnext/patches/v4_2/set_company_country.py
Normal file
15
erpnext/patches/v4_2/set_company_country.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import 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)
|
Loading…
x
Reference in New Issue
Block a user