[fix] Test cases and editable fields settings for request for quotation
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py
index d471da6..4efd098 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.py
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py
@@ -64,7 +64,9 @@
def check_opening_balance(asset, liability, equity):
# Check if previous year balance sheet closed
- opening_balance = flt(asset[0].get("opening_balance", 0))
+ opening_balance = 0
+ if asset:
+ opening_balance = flt(asset[0].get("opening_balance", 0))
if liability:
opening_balance -= flt(liability[0].get("opening_balance", 0))
if equity:
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index dbfda21..6416a23 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -12,7 +12,7 @@
erpnext.buying.BuyingController = erpnext.TransactionController.extend({
setup: function() {
this._super();
- if(!this.frm.get_field('items').grid.editable_fields){
+ if(!in_list(["Material Request", "Request for Quotation"], this.frm.doc.doctype)){
this.frm.get_field('items').grid.editable_fields = [
{fieldname: 'item_code', columns: 4},
{fieldname: 'qty', columns: 2},
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index 7218531..5fb8b80 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -14,6 +14,19 @@
filters: {'supplier': d.supplier}
}
}
+
+ frm.get_field('items').grid.editable_fields = [
+ {fieldname: 'item_code', columns: 4},
+ {fieldname: 'qty', columns: 2},
+ {fieldname: 'schedule_date', columns: 2},
+ {fieldname: 'warehouse', columns: 3},
+ ];
+
+ frm.get_field('suppliers').grid.editable_fields = [
+ {fieldname: 'supplier', columns: 5},
+ {fieldname: 'contact', columns: 3},
+ {fieldname: 'email_id', columns: 3}
+ ];
},
onload: function(frm){
diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
index d9b34eb..3399b51 100644
--- a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
+++ b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
@@ -147,7 +147,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-05-10 11:36:04.171180",
+ "modified": "2016-05-31 19:08:15.397706",
"modified_by": "Administrator",
"module": "Buying",
"name": "Request for Quotation Supplier",
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 10bbcfe..390bc27 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -36,4 +36,6 @@
cart_settings.enabled = 1
if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart": 1}, "name"):
self.assertRaises(ShoppingCartSetupError, cart_settings.validate_tax_rule)
+
+ frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 1")
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index a51852a..6eb8e49 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -101,7 +101,7 @@
quotation = self.create_quotation()
from erpnext.accounts.party import set_taxes
-
+
tax_rule_master = set_taxes(quotation.customer, "Customer", \
quotation.transaction_date, quotation.company, None, None, \
quotation.customer_address, quotation.shipping_address_name, 1)
@@ -131,6 +131,9 @@
"taxes": frappe.get_doc("Sales Taxes and Charges Template", "_Test Tax 1").taxes,
"company": "_Test Company"
}
+
+ for d in values["taxes"]:
+ d.name = None
quotation.update(values)