[fixes] minor fixes, added eval on pricing rule, Sales Order Item, Quotation Item
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index 170bf6f..57b4aca 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
@@ -731,6 +731,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "depends_on": "eval: doc.selling == 1",
"fieldname": "margin",
"fieldtype": "Section Break",
"hidden": 0,
@@ -755,6 +756,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "default": "Percentage",
"fieldname": "type",
"fieldtype": "Select",
"hidden": 0,
@@ -803,6 +805,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "default": "0",
"fieldname": "rate",
"fieldtype": "Float",
"hidden": 0,
@@ -1024,7 +1027,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-01-18 17:00:59.492217",
+ "modified": "2016-01-21 19:10:54.861787",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 78bae96..7802272 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -168,7 +168,9 @@
"discount_percentage": 0.0
})
else:
- item_details.discount_percentage = pricing_rule.discount_percentage
+ # if user changed the discount percentage then set discount_percentage of user
+ item_details.discount_percentage = pricing_rule.discount_percentage if args.discount_percentage == pricing_rule.discount_percentage\
+ else args.discount_percentage
return item_details
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 84c4652..96a9fbd 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -459,6 +459,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "depends_on": "eval:doc.price_list_rate",
"fieldname": "type",
"fieldtype": "Select",
"hidden": 0,
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 82b1342..3eb528f 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -302,7 +302,6 @@
callback: function(r) {
if(!r.exc){
var doc = frappe.model.sync(r.message);
- console.log(r.message)
frappe.set_route("Form", r.message.doctype, r.message.name);
}
}
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 1a79a42..68d26ac 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -497,7 +497,6 @@
# update the value
if fieldname in item and fieldname not in ("name", "doctype"):
item[fieldname] = children[i][fieldname]
-
return args
else:
return {