From 0b39e95011835517c9e91afc9b972474d0e1d590 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 31 Oct 2013 12:35:52 +0530 Subject: [PATCH 1/3] [cleanup] moved for territory, price list and item price doctype from setup to stock --- patches/august_2013/p02_rename_price_list.py | 2 +- patches/june_2013/p03_buying_selling_for_price_list.py | 4 ++-- patches/june_2013/p07_taxes_price_list_for_territory.py | 4 ++-- .../p02_update_price_list_and_item_details_in_item_price.py | 2 +- .../p03_modify_item_price_include_in_price_list.py | 4 ++-- {setup => stock}/doctype/for_territory/__init__.py | 0 {setup => stock}/doctype/for_territory/for_territory.py | 0 {setup => stock}/doctype/for_territory/for_territory.txt | 0 {setup => stock}/doctype/item_price/README.md | 0 {setup => stock}/doctype/item_price/__init__.py | 0 {setup => stock}/doctype/item_price/item_price.js | 0 {setup => stock}/doctype/item_price/item_price.py | 0 {setup => stock}/doctype/item_price/item_price.txt | 0 {setup => stock}/doctype/item_price/test_item_price.py | 0 {setup => stock}/doctype/price_list/README.md | 0 {setup => stock}/doctype/price_list/__init__.py | 0 {setup => stock}/doctype/price_list/price_list.css | 0 {setup => stock}/doctype/price_list/price_list.js | 0 {setup => stock}/doctype/price_list/price_list.py | 0 {setup => stock}/doctype/price_list/price_list.txt | 0 {setup => stock}/doctype/price_list/test_price_list.py | 0 21 files changed, 8 insertions(+), 8 deletions(-) rename {setup => stock}/doctype/for_territory/__init__.py (100%) rename {setup => stock}/doctype/for_territory/for_territory.py (100%) rename {setup => stock}/doctype/for_territory/for_territory.txt (100%) rename {setup => stock}/doctype/item_price/README.md (100%) rename {setup => stock}/doctype/item_price/__init__.py (100%) rename {setup => stock}/doctype/item_price/item_price.js (100%) rename {setup => stock}/doctype/item_price/item_price.py (100%) rename {setup => stock}/doctype/item_price/item_price.txt (100%) rename {setup => stock}/doctype/item_price/test_item_price.py (100%) rename {setup => stock}/doctype/price_list/README.md (100%) rename {setup => stock}/doctype/price_list/__init__.py (100%) rename {setup => stock}/doctype/price_list/price_list.css (100%) rename {setup => stock}/doctype/price_list/price_list.js (100%) rename {setup => stock}/doctype/price_list/price_list.py (100%) rename {setup => stock}/doctype/price_list/price_list.txt (100%) rename {setup => stock}/doctype/price_list/test_price_list.py (100%) diff --git a/patches/august_2013/p02_rename_price_list.py b/patches/august_2013/p02_rename_price_list.py index 0a1929925b..dbe268f0ad 100644 --- a/patches/august_2013/p02_rename_price_list.py +++ b/patches/august_2013/p02_rename_price_list.py @@ -6,7 +6,7 @@ import webnotes def execute(): webnotes.reload_doc("selling", "doctype", "shopping_cart_price_list") - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "item_price") for t in [ ("Supplier Quotation", "price_list_name", "buying_price_list"), diff --git a/patches/june_2013/p03_buying_selling_for_price_list.py b/patches/june_2013/p03_buying_selling_for_price_list.py index ead97ab2a8..61cddd0b28 100644 --- a/patches/june_2013/p03_buying_selling_for_price_list.py +++ b/patches/june_2013/p03_buying_selling_for_price_list.py @@ -7,8 +7,8 @@ from webnotes.utils import cint import MySQLdb def execute(): - webnotes.reload_doc("setup", "doctype", "price_list") - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "price_list") + webnotes.reload_doc("stock", "doctype", "item_price") try: for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""): diff --git a/patches/june_2013/p07_taxes_price_list_for_territory.py b/patches/june_2013/p07_taxes_price_list_for_territory.py index f57ecf8173..d523ea934b 100644 --- a/patches/june_2013/p07_taxes_price_list_for_territory.py +++ b/patches/june_2013/p07_taxes_price_list_for_territory.py @@ -4,8 +4,8 @@ import webnotes def execute(): - webnotes.reload_doc("setup", "doctype", "for_territory") - webnotes.reload_doc("setup", "doctype", "price_list") + webnotes.reload_doc("stock", "doctype", "for_territory") + webnotes.reload_doc("stock", "doctype", "price_list") webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master") webnotes.reload_doc("accounts", "doctype", "shipping_rule") diff --git a/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py b/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py index 209ebf3574..4a90b8c634 100644 --- a/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py +++ b/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes def execute(): - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "item_price") webnotes.conn.sql("""update `tabItem Price` ip, `tabItem` i set ip.item_name=i.item_name, ip.item_description=i.description diff --git a/patches/september_2013/p03_modify_item_price_include_in_price_list.py b/patches/september_2013/p03_modify_item_price_include_in_price_list.py index 8ca6d76f9c..2400918473 100644 --- a/patches/september_2013/p03_modify_item_price_include_in_price_list.py +++ b/patches/september_2013/p03_modify_item_price_include_in_price_list.py @@ -5,8 +5,8 @@ from __future__ import unicode_literals import webnotes def execute(): - webnotes.reload_doc("setup", "doctype", "price_list") - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "price_list") + webnotes.reload_doc("stock", "doctype", "item_price") webnotes.reload_doc("stock", "doctype", "item") webnotes.conn.sql("""update `tabItem Price` set parenttype='Price List', diff --git a/setup/doctype/for_territory/__init__.py b/stock/doctype/for_territory/__init__.py similarity index 100% rename from setup/doctype/for_territory/__init__.py rename to stock/doctype/for_territory/__init__.py diff --git a/setup/doctype/for_territory/for_territory.py b/stock/doctype/for_territory/for_territory.py similarity index 100% rename from setup/doctype/for_territory/for_territory.py rename to stock/doctype/for_territory/for_territory.py diff --git a/setup/doctype/for_territory/for_territory.txt b/stock/doctype/for_territory/for_territory.txt similarity index 100% rename from setup/doctype/for_territory/for_territory.txt rename to stock/doctype/for_territory/for_territory.txt diff --git a/setup/doctype/item_price/README.md b/stock/doctype/item_price/README.md similarity index 100% rename from setup/doctype/item_price/README.md rename to stock/doctype/item_price/README.md diff --git a/setup/doctype/item_price/__init__.py b/stock/doctype/item_price/__init__.py similarity index 100% rename from setup/doctype/item_price/__init__.py rename to stock/doctype/item_price/__init__.py diff --git a/setup/doctype/item_price/item_price.js b/stock/doctype/item_price/item_price.js similarity index 100% rename from setup/doctype/item_price/item_price.js rename to stock/doctype/item_price/item_price.js diff --git a/setup/doctype/item_price/item_price.py b/stock/doctype/item_price/item_price.py similarity index 100% rename from setup/doctype/item_price/item_price.py rename to stock/doctype/item_price/item_price.py diff --git a/setup/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt similarity index 100% rename from setup/doctype/item_price/item_price.txt rename to stock/doctype/item_price/item_price.txt diff --git a/setup/doctype/item_price/test_item_price.py b/stock/doctype/item_price/test_item_price.py similarity index 100% rename from setup/doctype/item_price/test_item_price.py rename to stock/doctype/item_price/test_item_price.py diff --git a/setup/doctype/price_list/README.md b/stock/doctype/price_list/README.md similarity index 100% rename from setup/doctype/price_list/README.md rename to stock/doctype/price_list/README.md diff --git a/setup/doctype/price_list/__init__.py b/stock/doctype/price_list/__init__.py similarity index 100% rename from setup/doctype/price_list/__init__.py rename to stock/doctype/price_list/__init__.py diff --git a/setup/doctype/price_list/price_list.css b/stock/doctype/price_list/price_list.css similarity index 100% rename from setup/doctype/price_list/price_list.css rename to stock/doctype/price_list/price_list.css diff --git a/setup/doctype/price_list/price_list.js b/stock/doctype/price_list/price_list.js similarity index 100% rename from setup/doctype/price_list/price_list.js rename to stock/doctype/price_list/price_list.js diff --git a/setup/doctype/price_list/price_list.py b/stock/doctype/price_list/price_list.py similarity index 100% rename from setup/doctype/price_list/price_list.py rename to stock/doctype/price_list/price_list.py diff --git a/setup/doctype/price_list/price_list.txt b/stock/doctype/price_list/price_list.txt similarity index 100% rename from setup/doctype/price_list/price_list.txt rename to stock/doctype/price_list/price_list.txt diff --git a/setup/doctype/price_list/test_price_list.py b/stock/doctype/price_list/test_price_list.py similarity index 100% rename from setup/doctype/price_list/test_price_list.py rename to stock/doctype/price_list/test_price_list.py From e158cea77ad528a391e22af70acda91f4caf5864 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 31 Oct 2013 19:50:51 +0530 Subject: [PATCH 2/3] [cleanup] [minor] replaced for territory to applicable territory --- .../sales_taxes_and_charges_master.js | 2 +- .../sales_taxes_and_charges_master.txt | 4 ++-- .../test_sales_taxes_and_charges_master.py | 6 +++--- .../doctype/shipping_rule/shipping_rule.js | 2 +- .../doctype/shipping_rule/shipping_rule.txt | 4 ++-- .../shipping_rule/test_shipping_rule.py | 2 +- .../p07_taxes_price_list_for_territory.py | 6 +++--- .../october_2013/p07_rename_for_territory.py | 21 +++++++++++++++++++ patches/patch_list.py | 3 ++- public/js/utils.js | 4 ++-- .../doctype/applicable_territory}/__init__.py | 0 .../applicable_territory.py | 2 +- .../applicable_territory.txt | 6 +++--- setup/doctype/setup_control/setup_control.py | 2 +- stock/doctype/item_price/item_price.txt | 4 ++-- stock/doctype/price_list/price_list.js | 2 +- stock/doctype/price_list/price_list.py | 2 +- stock/doctype/price_list/price_list.txt | 6 +++--- stock/doctype/price_list/test_price_list.py | 10 ++++----- utilities/demo/demo_docs/Price_List.csv | 2 +- 20 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 patches/october_2013/p07_rename_for_territory.py rename {stock/doctype/for_territory => setup/doctype/applicable_territory}/__init__.py (100%) rename stock/doctype/for_territory/for_territory.py => setup/doctype/applicable_territory/applicable_territory.py (80%) rename stock/doctype/for_territory/for_territory.txt => setup/doctype/applicable_territory/applicable_territory.txt (83%) diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js index f1a602738b..a7a88d4663 100644 --- a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js +++ b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js @@ -4,7 +4,7 @@ //--------- ONLOAD ------------- cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.doctype === "Sales Taxes and Charges Master") - erpnext.add_for_territory(); + erpnext.add_applicable_territory(); } cur_frm.cscript.refresh = function(doc, cdt, cdn) { diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt index 20e40768bd..cddf10ec85 100644 --- a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt +++ b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:09", "docstatus": 0, - "modified": "2013-07-22 15:22:14", + "modified": "2013-10-31 19:25:09", "modified_by": "Administrator", "owner": "Administrator" }, @@ -94,7 +94,7 @@ "fieldname": "valid_for_territories", "fieldtype": "Table", "label": "Valid for Territories", - "options": "For Territory", + "options": "Applicable Territory", "reqd": 1 }, { diff --git a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py b/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py index 74b0b4edb4..7a013fbf48 100644 --- a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py +++ b/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py @@ -25,7 +25,7 @@ test_records = [ "rate": 6.36, }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" } @@ -113,7 +113,7 @@ test_records = [ "row_id": 7 }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory India" } @@ -141,7 +141,7 @@ test_records = [ "rate": 4, }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" } diff --git a/accounts/doctype/shipping_rule/shipping_rule.js b/accounts/doctype/shipping_rule/shipping_rule.js index 2aeb8ddcd3..2a0c433996 100644 --- a/accounts/doctype/shipping_rule/shipping_rule.js +++ b/accounts/doctype/shipping_rule/shipping_rule.js @@ -3,6 +3,6 @@ $.extend(cur_frm.cscript, { onload: function() { - erpnext.add_for_territory(); + erpnext.add_applicable_territory(); } }); \ No newline at end of file diff --git a/accounts/doctype/shipping_rule/shipping_rule.txt b/accounts/doctype/shipping_rule/shipping_rule.txt index 43589b49a3..27aaa70115 100644 --- a/accounts/doctype/shipping_rule/shipping_rule.txt +++ b/accounts/doctype/shipping_rule/shipping_rule.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-25 11:48:03", "docstatus": 0, - "modified": "2013-07-05 14:55:00", + "modified": "2013-10-31 19:24:50", "modified_by": "Administrator", "owner": "Administrator" }, @@ -87,7 +87,7 @@ "fieldname": "valid_for_territories", "fieldtype": "Table", "label": "Valid For Territories", - "options": "For Territory", + "options": "Applicable Territory", "reqd": 1 }, { diff --git a/accounts/doctype/shipping_rule/test_shipping_rule.py b/accounts/doctype/shipping_rule/test_shipping_rule.py index f85909e2c0..a9aa4c702e 100644 --- a/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -62,7 +62,7 @@ test_records = [ "shipping_amount": 0.0 }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory" } diff --git a/patches/june_2013/p07_taxes_price_list_for_territory.py b/patches/june_2013/p07_taxes_price_list_for_territory.py index d523ea934b..f6663bf6af 100644 --- a/patches/june_2013/p07_taxes_price_list_for_territory.py +++ b/patches/june_2013/p07_taxes_price_list_for_territory.py @@ -4,7 +4,7 @@ import webnotes def execute(): - webnotes.reload_doc("stock", "doctype", "for_territory") + webnotes.reload_doc("setup", "doctype", "applicable_territory") webnotes.reload_doc("stock", "doctype", "price_list") webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master") webnotes.reload_doc("accounts", "doctype", "shipping_rule") @@ -14,12 +14,12 @@ def execute(): for parenttype in ["Sales Taxes and Charges Master", "Price List", "Shipping Rule"]: for name in webnotes.conn.sql_list("""select name from `tab%s` main - where not exists (select parent from `tabFor Territory` territory + where not exists (select parent from `tabApplicable Territory` territory where territory.parenttype=%s and territory.parent=main.name)""" % \ (parenttype, "%s"), (parenttype,)): doc = webnotes.doc({ - "doctype": "For Territory", + "doctype": "Applicable Territory", "__islocal": 1, "parenttype": parenttype, "parentfield": "valid_for_territories", diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py new file mode 100644 index 0000000000..2317002fe6 --- /dev/null +++ b/patches/october_2013/p07_rename_for_territory.py @@ -0,0 +1,21 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes, os + +def execute(): + webnotes.reload_doc("core", "doctype", "doctype") + + tables = webnotes.conn.sql_list("show tables") + + if "tabApplicable Territory" not in tables: + webnotes.rename_doc("DocType", "For Territory", "Applicable Territory", force=True) + + webnotes.reload_doc("setup", "doctype", "applicable_territory") + + if os.path.exists("app/setup/doctype/for_territory"): + os.system("rm -rf app/setup/doctype/for_territory") + + if webnotes.conn.exists("DocType", "For Territory"): + webnotes.delete_doc("DocType", "For Territory") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 37220abe1f..67affb6de1 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -163,7 +163,6 @@ patch_list = [ "execute:webnotes.delete_doc('Report', 'Sales Orders Pending To Be Delivered')", "patches.june_2013.p05_remove_unused_doctypes", "patches.june_2013.p06_drop_unused_tables", - "patches.june_2013.p07_taxes_price_list_for_territory", "patches.june_2013.p08_shopping_cart_settings", "patches.june_2013.p09_update_global_defaults", "patches.june_2013.p10_lead_address", @@ -228,4 +227,6 @@ patch_list = [ "patches.october_2013.p04_update_report_permission", "patches.october_2013.p05_delete_gl_entries_for_cancelled_vouchers", "patches.october_2013.p06_update_control_panel_and_global_defaults", + "patches.october_2013.p07_rename_for_territory", + "patches.june_2013.p07_taxes_price_list_for_territory", ] \ No newline at end of file diff --git a/public/js/utils.js b/public/js/utils.js index 61e613bdec..2dccd35b1f 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -28,10 +28,10 @@ $.extend(erpnext, { } }, - add_for_territory: function() { + add_applicable_territory: function() { if(cur_frm.doc.__islocal && wn.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) { - var territory = wn.model.add_child(cur_frm.doc, "For Territory", + var territory = wn.model.add_child(cur_frm.doc, "Applicable Territory", "valid_for_territories"); territory.territory = wn.defaults.get_default("territory"); } diff --git a/stock/doctype/for_territory/__init__.py b/setup/doctype/applicable_territory/__init__.py similarity index 100% rename from stock/doctype/for_territory/__init__.py rename to setup/doctype/applicable_territory/__init__.py diff --git a/stock/doctype/for_territory/for_territory.py b/setup/doctype/applicable_territory/applicable_territory.py similarity index 80% rename from stock/doctype/for_territory/for_territory.py rename to setup/doctype/applicable_territory/applicable_territory.py index 784339de7d..3256c80d42 100644 --- a/stock/doctype/for_territory/for_territory.py +++ b/setup/doctype/applicable_territory/applicable_territory.py @@ -1,5 +1,5 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. -# License: GNU General Public License v3. See license.txt +# MIT License. See license.txt # For license information, please see license.txt diff --git a/stock/doctype/for_territory/for_territory.txt b/setup/doctype/applicable_territory/applicable_territory.txt similarity index 83% rename from stock/doctype/for_territory/for_territory.txt rename to setup/doctype/applicable_territory/applicable_territory.txt index be454ec018..31064deec5 100644 --- a/stock/doctype/for_territory/for_territory.txt +++ b/setup/doctype/applicable_territory/applicable_territory.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-20 12:48:38", "docstatus": 0, - "modified": "2013-07-10 14:54:09", + "modified": "2013-10-31 18:56:54", "modified_by": "Administrator", "owner": "Administrator" }, @@ -20,7 +20,7 @@ "label": "Territory", "name": "__common__", "options": "Territory", - "parent": "For Territory", + "parent": "Applicable Territory", "parentfield": "fields", "parenttype": "DocType", "permlevel": 0, @@ -28,7 +28,7 @@ }, { "doctype": "DocType", - "name": "For Territory" + "name": "Applicable Territory" }, { "doctype": "DocField" diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index 818e310425..9599e58c78 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -85,7 +85,7 @@ class DocType: "currency": args["currency"] }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" } diff --git a/stock/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt index 779bbd47e0..fc411eb1d6 100644 --- a/stock/doctype/item_price/item_price.txt +++ b/stock/doctype/item_price/item_price.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-02 16:29:48", "docstatus": 0, - "modified": "2013-10-21 15:11:20", + "modified": "2013-10-31 12:59:02", "modified_by": "Administrator", "owner": "Administrator" }, @@ -14,7 +14,7 @@ "icon": "icon-flag", "in_create": 0, "istable": 0, - "module": "Setup", + "module": "Stock", "name": "__common__", "read_only": 0 }, diff --git a/stock/doctype/price_list/price_list.js b/stock/doctype/price_list/price_list.js index 84c4c2f957..be3aeaab33 100644 --- a/stock/doctype/price_list/price_list.js +++ b/stock/doctype/price_list/price_list.js @@ -3,7 +3,7 @@ $.extend(cur_frm.cscript, { onload: function() { - erpnext.add_for_territory(); + erpnext.add_applicable_territory(); }, refresh: function() { diff --git a/stock/doctype/price_list/price_list.py b/stock/doctype/price_list/price_list.py index d94b78e19a..993f4ea94b 100644 --- a/stock/doctype/price_list/price_list.py +++ b/stock/doctype/price_list/price_list.py @@ -18,7 +18,7 @@ class DocType(DocListController): # if no territory, set default territory if webnotes.defaults.get_user_default("territory"): self.doclist.append({ - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": webnotes.defaults.get_user_default("territory") }) diff --git a/stock/doctype/price_list/price_list.txt b/stock/doctype/price_list/price_list.txt index b93cfcc2c3..d43076bcc8 100644 --- a/stock/doctype/price_list/price_list.txt +++ b/stock/doctype/price_list/price_list.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-25 11:35:09", "docstatus": 0, - "modified": "2013-10-18 13:33:07", + "modified": "2013-10-31 19:24:33", "modified_by": "Administrator", "owner": "Administrator" }, @@ -17,7 +17,7 @@ "document_type": "Master", "icon": "icon-tags", "max_attachments": 1, - "module": "Setup", + "module": "Stock", "name": "__common__" }, { @@ -81,7 +81,7 @@ "fieldname": "valid_for_territories", "fieldtype": "Table", "label": "Valid for Territories", - "options": "For Territory", + "options": "Applicable Territory", "reqd": 1 }, { diff --git a/stock/doctype/price_list/test_price_list.py b/stock/doctype/price_list/test_price_list.py index d5174ed7fc..e3fa791e42 100644 --- a/stock/doctype/price_list/test_price_list.py +++ b/stock/doctype/price_list/test_price_list.py @@ -15,7 +15,7 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" }, @@ -28,7 +28,7 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory Rest of the World" } @@ -41,7 +41,7 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory India" } @@ -54,12 +54,12 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory Rest of the World" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory United States" } diff --git a/utilities/demo/demo_docs/Price_List.csv b/utilities/demo/demo_docs/Price_List.csv index fb412399e1..1e0dcec7f9 100644 --- a/utilities/demo/demo_docs/Price_List.csv +++ b/utilities/demo/demo_docs/Price_List.csv @@ -11,7 +11,7 @@ Only mandatory fields are necessary for new records. You can delete non-mandator "For updating, you can update only selective columns.",,,,,,,,,,, You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,, ,,,,,,,,,,, -DocType:,Price List,,,,~,For Territory,valid_for_territories,~,Item Price,item_prices, +DocType:,Price List,,,,~,Applicable Territory,valid_for_territories,~,Item Price,item_prices, Column Labels:,ID,Price List Name,Currency,Valid for Buying or Selling?,,ID,Territory,,ID,Item Code,Rate Column Name:,name,price_list_name,currency,buying_or_selling,~,name,territory,~,name,item_code,ref_rate Mandatory:,Yes,Yes,Yes,Yes,,Yes,Yes,,Yes,Yes,Yes From 9c1488a7c0fc34142559d09b621f32eb35b08797 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 31 Oct 2013 19:56:31 +0530 Subject: [PATCH 3/3] [cleanup] [minor] for territory fixed to applicable territory --- .../doctype/shopping_cart_settings/shopping_cart_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py index f3954584e7..d23f5e232d 100644 --- a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -72,7 +72,7 @@ class DocType(DocListController): # make a map of territory: [list of names] # if list against each territory has more than one element, raise exception territory_name = webnotes.conn.sql("""select `territory`, `parent` - from `tabFor Territory` + from `tabApplicable Territory` where `parenttype`=%s and `parent` in (%s)""" % ("%s", ", ".join(["%s"]*len(names))), tuple([parenttype] + names))