mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Fixes based on test case
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user