fix: allow operators, make weighting_function mandatory
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json
index 95dc751..6a077e9 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json
@@ -252,7 +252,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 9d5b331..d34a3fb 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -507,4 +507,5 @@
erpnext.patches.v10_0.recalculate_gross_margin_for_project
erpnext.patches.v10_0.delete_hub_documents
erpnext.patches.v10_0.update_user_image_in_employee
-erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
\ No newline at end of file
+erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
+erpnext.patches.v10_0.allow_operators_in_supplier_scorecard
\ No newline at end of file
diff --git a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py
new file mode 100644
index 0000000..27478f3
--- /dev/null
+++ b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2019, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ for criteria in frappe.get_all('Supplier Scorecard Criteria', fields=['name', 'formula'], limit_page_length=None):
+ frappe.db.set_value('Supplier Scorecard Criteria', criteria.name,
+ 'formula', criteria.formula.replace('<','<').replace('>','>'))
+
+ for criteria in frappe.get_all('Supplier Scorecard Scoring Criteria', fields=['name', 'formula'], limit_page_length=None):
+ if criteria.formula: # not mandatory
+ frappe.db.set_value('Supplier Scorecard Scoring Criteria', criteria.name,
+ 'formula', criteria.formula.replace('<','<').replace('>','>'))
+
+ for sc in frappe.get_all('Supplier Scorecard', fields=['name', 'weighting_function'], limit_page_length=None):
+ frappe.db.set_value('Supplier Scorecard', sc.name, 'weighting_function',
+ sc.weighting_function.replace('<','<').replace('>','>'))
\ No newline at end of file