mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
appraisal template, total must be 100
This commit is contained in:
@@ -25,8 +25,9 @@ class DocType:
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
self.doc.total_points = 0
|
self.doc.total_points = 0
|
||||||
for d in self.doclist.get({"doctype":"Appraisal Template Goal"}):
|
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:
|
if int(self.doc.total_points) != 100:
|
||||||
webnotes.msgprint(_("Total Points should be 100") + ":" + self.doc.total_points,
|
webnotes.msgprint(_("Total (sum of) points distribution for all goals should be 100.") \
|
||||||
|
+ " " + _("Not") + " " + str(self.doc.total_points),
|
||||||
raise_exception=True)
|
raise_exception=True)
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-07-03 13:30:39",
|
"creation": "2012-07-03 13:30:39",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2013-01-07 15:11:55"
|
"modified": "2013-01-07 17:16:25"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"autoname": "field:kra_title",
|
"autoname": "field:kra_title",
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
{
|
{
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "KRA Title",
|
"label": "Appraisal Template Title",
|
||||||
"oldfieldname": "kra_title",
|
"oldfieldname": "kra_title",
|
||||||
"fieldname": "kra_title",
|
"fieldname": "kra_title",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
|
|||||||
Reference in New Issue
Block a user