From e9778d9556d37dd89c00c4c0a8de802fc112551f Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 23 Jan 2019 16:58:42 +0530 Subject: [PATCH] fix: do not use built-in "input", reload_doc --- .../supplier_scorecard_period/supplier_scorecard_period.py | 4 ++-- .../patches/v10_0/allow_operators_in_supplier_scorecard.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py index 15ba3f93ba..737ddd6ddd 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py @@ -61,8 +61,8 @@ class SupplierScorecardPeriod(Document): return weighed_score - def get_eval_statement(self, input): - my_eval_statement = input.replace("\r", "").replace("\n", "") + def get_eval_statement(self, formula): + my_eval_statement = formula.replace("\r", "").replace("\n", "") for var in self.variables: if var.value: diff --git a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py index 27478f3ad5..827f9bc94f 100644 --- a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py +++ b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py @@ -5,6 +5,10 @@ from __future__ import unicode_literals import frappe def execute(): + frappe.reload_doc('buying', 'doctype', 'supplier_scorecard_criteria') + frappe.reload_doc('buying', 'doctype', 'supplier_scorecard_scoring_criteria') + frappe.reload_doc('buying', 'doctype', 'supplier_scorecard') + 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('>','>'))