[fix] [patch] convert applicable territory

This commit is contained in:
Anand Doshi 2015-09-24 13:08:35 +05:30
parent b126ba0132
commit c020e42d20

View File

@ -5,6 +5,8 @@ def execute():
countries = frappe.db.sql_list("select name from tabCountry")
for doctype in ("Price List", "Shipping Rule"):
frappe.reload_doctype(doctype)
for at in frappe.db.sql("""select name, parent, territory from `tabApplicable Territory` where
parenttype = %s """, doctype, as_dict=True):
if at.territory in countries: