[webshop] territories in price list, taxes, updates in shopping cart settings

This commit is contained in:
Anand Doshi
2013-06-21 17:55:31 +05:30
parent d52b03a8cc
commit 61a2f68bc6
33 changed files with 462 additions and 137 deletions

View File

@@ -1,5 +0,0 @@
import webnotes
def execute():
webnotes.reload_doc("Setup", "DocType", "Price List")
webnotes.conn.sql("""update `tabPrice List` set valid_for_all_countries=1""")

View File

@@ -0,0 +1,25 @@
import webnotes
def execute():
webnotes.reload_doc("setup", "doctype", "for_territory")
webnotes.reload_doc("setup", "doctype", "price_list")
webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master")
from setup.utils import get_root_of
root_territory = get_root_of("Territory")
for parenttype in ["Sales Taxes and Charges Master", "Price List"]:
for name in webnotes.conn.sql_list("""select name from `tab%s` main
where not exists (select parent from `tabFor Territory` territory
where territory.parenttype=%s and territory.parent=main.name)""" % \
(parenttype, "%s"), (parenttype,)):
doc = webnotes.doc({
"doctype": "For Territory",
"__islocal": 1,
"parenttype": parenttype,
"parentfield": "valid_for_territories",
"parent": name,
"territory": root_territory
})
doc.save()

View File

@@ -0,0 +1,11 @@
import webnotes
def execute():
webnotes.reload_doc("website", "doctype", "shopping_cart_settings")
# create two default territories, one for home country and one named Rest of the World
from setup.doctype.setup_control.setup_control import create_territories
create_territories()
webnotes.conn.set_value("Shopping Cart Settings", None, "default_territory", "Rest of the World")

View File

@@ -226,7 +226,6 @@ patch_list = [
"execute:webnotes.reset_perms('File Data')",
"patches.april_2013.p07_update_file_data_2",
"patches.april_2013.rebuild_sales_browser",
"patches.april_2013.p08_price_list_country",
"patches.may_2013.p01_selling_net_total_export",
"patches.may_2013.repost_stock_for_no_posting_time",
"patches.may_2013.p01_conversion_factor_and_aii",
@@ -245,4 +244,5 @@ patch_list = [
"patches.june_2013.p04_fix_event_for_lead_oppty_project",
"patches.june_2013.p05_remove_unused_doctypes",
"patches.june_2013.p06_drop_unused_tables",
"patches.june_2013.p08_shopping_cart_settings",
]