Fixes in Test Cases
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py
index ee753d5..670edc4 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py
@@ -28,6 +28,11 @@
"doctype": "Applicable Territory",
"parentfield": "valid_for_territories",
"territory": "All Territories"
+ },
+ {
+ "doctype": "Applicable Territory",
+ "parentfield": "valid_for_territories",
+ "territory": "_Test Territory Rest Of The World"
}
],
[
@@ -121,7 +126,7 @@
[
{
"doctype": "Sales Taxes and Charges Master",
- "title": "_Test Sales Taxes and Charges Master 2",
+ "title": "_Test Sales Taxes and Charges Master - Rest of the World",
"company": "_Test Company"
},
{
@@ -143,7 +148,7 @@
{
"doctype": "Applicable Territory",
"parentfield": "valid_for_territories",
- "territory": "All Territories"
+ "territory": "_Test Territory Rest Of The World"
}
],
]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
index 6bf6bd3..ad99a51 100644
--- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
@@ -36,6 +36,7 @@
{
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule",
+ "name": "_Test Shipping Rule",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"account": "_Test Account Shipping Charges - _TC",
@@ -66,5 +67,77 @@
"parentfield": "valid_for_territories",
"territory": "_Test Territory"
}
- ]
+ ],
+ [
+ {
+ "doctype": "Shipping Rule",
+ "name": "_Test Shipping Rule - India",
+ "label": "_Test Shipping Rule - India",
+ "calculate_based_on": "Net Total",
+ "company": "_Test Company",
+ "account": "_Test Account Shipping Charges - _TC",
+ "cost_center": "_Test Cost Center - _TC"
+ },
+ {
+ "doctype": "Shipping Rule Condition",
+ "parentfield": "shipping_rule_conditions",
+ "from_value": 0,
+ "to_value": 100,
+ "shipping_amount": 50.0
+ },
+ {
+ "doctype": "Shipping Rule Condition",
+ "parentfield": "shipping_rule_conditions",
+ "from_value": 101,
+ "to_value": 200,
+ "shipping_amount": 100.0
+ },
+ {
+ "doctype": "Shipping Rule Condition",
+ "parentfield": "shipping_rule_conditions",
+ "from_value": 201,
+ "shipping_amount": 0.0
+ },
+ {
+ "doctype": "Applicable Territory",
+ "parentfield": "valid_for_territories",
+ "territory": "_Test Territory India"
+ }
+ ],
+ [
+ {
+ "doctype": "Shipping Rule",
+ "name": "_Test Shipping Rule - Rest of the World",
+ "label": "_Test Shipping Rule - Rest of the World",
+ "calculate_based_on": "Net Total",
+ "company": "_Test Company",
+ "account": "_Test Account Shipping Charges - _TC",
+ "cost_center": "_Test Cost Center - _TC"
+ },
+ {
+ "doctype": "Shipping Rule Condition",
+ "parentfield": "shipping_rule_conditions",
+ "from_value": 0,
+ "to_value": 1000,
+ "shipping_amount": 500.0
+ },
+ {
+ "doctype": "Shipping Rule Condition",
+ "parentfield": "shipping_rule_conditions",
+ "from_value": 1001,
+ "to_value": 2000,
+ "shipping_amount": 1000.0
+ },
+ {
+ "doctype": "Shipping Rule Condition",
+ "parentfield": "shipping_rule_conditions",
+ "from_value": 2001,
+ "shipping_amount": 1500.0
+ },
+ {
+ "doctype": "Applicable Territory",
+ "parentfield": "valid_for_territories",
+ "territory": "_Test Territory Rest Of The World"
+ }
+ ],
]
\ No newline at end of file
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 495284a..9f65452 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -370,7 +370,7 @@
webnotes.conn.set_value("Account", new_account or old_account, "master_name", newdn)
def add_abbr_if_missing(dn, company):
- from setup.doctype.company.company import get_name_with_abbr
+ from ..setup.doctype.company.company import get_name_with_abbr
return get_name_with_abbr(dn, company)
def get_account_for(account_for_doctype, account_for):
diff --git a/erpnext/setup/doctype/territory/test_territory.py b/erpnext/setup/doctype/territory/test_territory.py
index 54d99ed..3068b5f 100644
--- a/erpnext/setup/doctype/territory/test_territory.py
+++ b/erpnext/setup/doctype/territory/test_territory.py
@@ -22,7 +22,7 @@
}],
[{
"doctype": "Territory",
- "territory_name": "_Test Territory Rest of the World",
+ "territory_name": "_Test Territory Rest Of The World",
"parent_territory": "All Territories",
"is_group": "No",
}],
diff --git a/erpnext/stock/doctype/price_list/test_price_list.py b/erpnext/stock/doctype/price_list/test_price_list.py
index 803be27..c601b77 100644
--- a/erpnext/stock/doctype/price_list/test_price_list.py
+++ b/erpnext/stock/doctype/price_list/test_price_list.py
@@ -32,7 +32,7 @@
{
"doctype": "Applicable Territory",
"parentfield": "valid_for_territories",
- "territory": "_Test Territory Rest of the World"
+ "territory": "_Test Territory Rest Of The World"
}
],
[
@@ -60,7 +60,7 @@
{
"doctype": "Applicable Territory",
"parentfield": "valid_for_territories",
- "territory": "_Test Territory Rest of the World"
+ "territory": "_Test Territory Rest Of The World"
},
{
"doctype": "Applicable Territory",
diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py
index 68f1d95..9fbb5c4 100644
--- a/erpnext/support/doctype/newsletter/newsletter.py
+++ b/erpnext/support/doctype/newsletter/newsletter.py
@@ -44,6 +44,7 @@
webnotes.conn.set(self.doc, "email_sent", 1)
def get_recipients(self):
+ self.email_field = None
if self.doc.send_to_type=="Contact":
self.send_to_doctype = "Contact"
if self.doc.contact_type == "Customer":