appraisal template, total must be 100

This commit is contained in:
Rushabh Mehta 2013-01-07 17:43:12 +05:30
parent 143ea718c3
commit b8f39f00d8
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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",