task made mandatory in project
This commit is contained in:
parent
a11770f06f
commit
aabf150423
@ -130,7 +130,8 @@
|
||||
"label": "Tasks",
|
||||
"options": "Project Task",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
"precision": "",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "percent_complete",
|
||||
@ -278,7 +279,7 @@
|
||||
"icon": "icon-puzzle-piece",
|
||||
"idx": 1,
|
||||
"max_attachments": 4,
|
||||
"modified": "2015-03-30 08:42:33.940104",
|
||||
"modified": "2015-03-31 06:12:03.372091",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Project",
|
||||
|
@ -34,11 +34,18 @@ class Project(Document):
|
||||
return ret
|
||||
|
||||
def validate(self):
|
||||
self.validate_dates()
|
||||
self.validate_tasks()
|
||||
self.sync_tasks()
|
||||
|
||||
def validate_dates(self):
|
||||
if self.project_start_date and self.completion_date:
|
||||
if getdate(self.completion_date) < getdate(self.project_start_date):
|
||||
frappe.throw(_("Expected Completion Date can not be less than Project Start Date"))
|
||||
|
||||
self.sync_tasks()
|
||||
|
||||
def validate_tasks(self):
|
||||
if not self.tasks:
|
||||
frappe.throw("Task is mandatory against a project")
|
||||
|
||||
def sync_tasks(self):
|
||||
"""sync tasks and remove table"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user