Minor fixes
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index e15cea8..2d318c6 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
@@ -127,18 +127,18 @@
"permlevel": 0
},
{
- "fieldname": "max_qty",
- "fieldtype": "Float",
- "label": "Max Qty",
- "permlevel": 0
- },
- {
"fieldname": "min_qty",
"fieldtype": "Float",
"label": "Min Qty",
"permlevel": 0
},
{
+ "fieldname": "max_qty",
+ "fieldtype": "Float",
+ "label": "Max Qty",
+ "permlevel": 0
+ },
+ {
"fieldname": "col_break1",
"fieldtype": "Column Break",
"permlevel": 0
@@ -235,7 +235,7 @@
"icon": "icon-gift",
"idx": 1,
"istable": 0,
- "modified": "2014-06-19 15:00:09.962572",
+ "modified": "2014-06-20 19:36:22.502381",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
@@ -244,8 +244,8 @@
{
"create": 1,
"delete": 1,
- "export": 0,
- "import": 0,
+ "export": 1,
+ "import": 1,
"permlevel": 0,
"read": 1,
"report": 1,
@@ -290,7 +290,6 @@
"permlevel": 0,
"read": 1,
"report": 1,
- "restrict": 1,
"role": "System Manager",
"write": 1
}
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 77b52b1..967d583 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -66,7 +66,7 @@
if self.price_or_discount == "Discount Percentage" and self.item_code:
max_discount = frappe.db.get_value("Item", self.item_code, "max_discount")
if max_discount and flt(self.discount_percentage) > flt(max_discount):
- throw(_("Max discount allowed for item: {0} is {1}%".format(self.item_code, max_discount)))
+ throw(_("Max discount allowed for item: {0} is {1}%").format(self.item_code, max_discount))
#--------------------------------------------------------------------------------
@@ -141,7 +141,8 @@
item_details.pricing_rule = pricing_rule.name
if pricing_rule.price_or_discount == "Price":
item_details.update({
- "price_list_rate": pricing_rule.price*flt(args.plc_conversion_rate)/flt(args.conversion_rate),
+ "price_list_rate": pricing_rule.price/flt(args.conversion_rate) \
+ if args.conversion_rate else 0.0,
"discount_percentage": 0.0
})
else:
@@ -167,10 +168,10 @@
conditions = ""
for field in ["company", "customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
- if args.get(field):
- conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
- else:
- conditions += " and ifnull("+field+", '') = ''"
+ if args.get(field):
+ conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
+ else:
+ conditions += " and ifnull("+field+", '') = ''"
for parenttype in ["Customer Group", "Territory"]:
group_condition = _get_tree_conditions(parenttype)