Fixes based on test case

This commit is contained in:
Nabin Hait
2017-09-28 18:55:40 +05:30
parent 3b04cfc812
commit c314485d55
8 changed files with 22 additions and 10 deletions

View File

@@ -53,12 +53,17 @@ class Project(Document):
return frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc")
def validate(self):
self.validate_project_name()
self.validate_dates()
self.validate_weights()
self.sync_tasks()
self.tasks = []
self.send_welcome_email()
def validate_project_name(self):
if frappe.db.exists("Project", self.project_name):
frappe.throw(_("Project {0} already exists").format(self.project_name))
def validate_dates(self):
if self.expected_start_date and self.expected_end_date:
if getdate(self.expected_end_date) < getdate(self.expected_start_date):