mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
task made mandatory in project
This commit is contained in:
@@ -130,7 +130,8 @@
|
|||||||
"label": "Tasks",
|
"label": "Tasks",
|
||||||
"options": "Project Task",
|
"options": "Project Task",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": ""
|
"precision": "",
|
||||||
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "percent_complete",
|
"fieldname": "percent_complete",
|
||||||
@@ -278,7 +279,7 @@
|
|||||||
"icon": "icon-puzzle-piece",
|
"icon": "icon-puzzle-piece",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"max_attachments": 4,
|
"max_attachments": 4,
|
||||||
"modified": "2015-03-30 08:42:33.940104",
|
"modified": "2015-03-31 06:12:03.372091",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Project",
|
"name": "Project",
|
||||||
|
|||||||
@@ -34,11 +34,18 @@ class Project(Document):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def validate(self):
|
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 self.project_start_date and self.completion_date:
|
||||||
if getdate(self.completion_date) < getdate(self.project_start_date):
|
if getdate(self.completion_date) < getdate(self.project_start_date):
|
||||||
frappe.throw(_("Expected Completion Date can not be less than 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):
|
def sync_tasks(self):
|
||||||
"""sync tasks and remove table"""
|
"""sync tasks and remove table"""
|
||||||
|
|||||||
Reference in New Issue
Block a user