From b8f39f00d81975b14d2ee172bee08d5701247527 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 7 Jan 2013 17:43:12 +0530 Subject: [PATCH] appraisal template, total must be 100 --- hr/doctype/appraisal_template/appraisal_template.py | 7 ++++--- hr/doctype/appraisal_template/appraisal_template.txt | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hr/doctype/appraisal_template/appraisal_template.py b/hr/doctype/appraisal_template/appraisal_template.py index 7081dae30d..e43f36a886 100644 --- a/hr/doctype/appraisal_template/appraisal_template.py +++ b/hr/doctype/appraisal_template/appraisal_template.py @@ -25,8 +25,9 @@ class DocType: def validate(self): self.doc.total_points = 0 for d in self.doclist.get({"doctype":"Appraisal Template Goal"}): - self.doc.total_points += int(d.weightage_per or 0) + self.doc.total_points += int(d.per_weightage or 0) - if self.doc.total_points != 100: - webnotes.msgprint(_("Total Points should be 100") + ":" + self.doc.total_points, + if int(self.doc.total_points) != 100: + webnotes.msgprint(_("Total (sum of) points distribution for all goals should be 100.") \ + + " " + _("Not") + " " + str(self.doc.total_points), raise_exception=True) \ No newline at end of file diff --git a/hr/doctype/appraisal_template/appraisal_template.txt b/hr/doctype/appraisal_template/appraisal_template.txt index 0240e52f86..2a66bd39b4 100644 --- a/hr/doctype/appraisal_template/appraisal_template.txt +++ b/hr/doctype/appraisal_template/appraisal_template.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-07-03 13:30:39", "modified_by": "Administrator", - "modified": "2013-01-07 15:11:55" + "modified": "2013-01-07 17:16:25" }, { "autoname": "field:kra_title", @@ -40,7 +40,7 @@ { "oldfieldtype": "Data", "doctype": "DocField", - "label": "KRA Title", + "label": "Appraisal Template Title", "oldfieldname": "kra_title", "fieldname": "kra_title", "fieldtype": "Data",