[fix] [patch] convert_applicable_territory

This commit is contained in:
Anand Doshi 2015-09-24 14:59:06 +05:30
parent 1d621be1f7
commit f66e6aacd4

View File

@ -1,12 +1,14 @@
import frappe import frappe
def execute(): def execute():
frappe.reload_doctype("Price List Country")
frappe.reload_doctype("Price List")
frappe.reload_doctype("Shipping Rule")
# for price list # for price list
countries = frappe.db.sql_list("select name from tabCountry") countries = frappe.db.sql_list("select name from tabCountry")
for doctype in ("Price List", "Shipping Rule"): 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 for at in frappe.db.sql("""select name, parent, territory from `tabApplicable Territory` where
parenttype = %s """, doctype, as_dict=True): parenttype = %s """, doctype, as_dict=True):
if at.territory in countries: if at.territory in countries: