[cleanup] added single price list for shopping cart, removed Applicable Territory

This commit is contained in:
Rushabh Mehta
2015-09-17 18:29:44 +05:30
parent 8ffd483e24
commit 72fbf902d7
19 changed files with 149 additions and 371 deletions

View File

@@ -0,0 +1,17 @@
import frappe
def execute():
# for price list
countries = frappe.db.sql_list("select name from tabCountry")
for doctype in ("Price List", "Shipping Rule"):
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:
parent = frappe.get_doc(doctype, at.parent)
if not parent.countries:
parent.append("countries", {"country": at.territory})
parent.save()
frappe.delete_doc("DocType", "Applicable Territory")