mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
Merge pull request #51224 from aerele/task-end-date
This commit is contained in:
@@ -98,7 +98,7 @@ class Task(NestedSet):
|
|||||||
self.validate_parent_project_dates()
|
self.validate_parent_project_dates()
|
||||||
|
|
||||||
def set_default_end_date_if_missing(self):
|
def set_default_end_date_if_missing(self):
|
||||||
if self.exp_start_date and self.expected_time:
|
if self.exp_start_date and self.expected_time and not self.exp_end_date:
|
||||||
self.exp_end_date = add_to_date(self.exp_start_date, hours=self.expected_time)
|
self.exp_end_date = add_to_date(self.exp_start_date, hours=self.expected_time)
|
||||||
|
|
||||||
def validate_parent_expected_end_date(self):
|
def validate_parent_expected_end_date(self):
|
||||||
|
|||||||
@@ -158,6 +158,12 @@ class TestTask(ERPNextTestSuite):
|
|||||||
|
|
||||||
self.assertRaises(ParentIsGroupError, child_task.save)
|
self.assertRaises(ParentIsGroupError, child_task.save)
|
||||||
|
|
||||||
|
def test_expected_end_date(self):
|
||||||
|
task = create_task("Testing End Date", add_days(nowdate(), 1), add_days(nowdate(), 5))
|
||||||
|
task.expected_time = 72
|
||||||
|
task.save()
|
||||||
|
self.assertEqual(getdate(task.exp_end_date), getdate(add_days(nowdate(), 5)))
|
||||||
|
|
||||||
|
|
||||||
def create_task(
|
def create_task(
|
||||||
subject,
|
subject,
|
||||||
|
|||||||
Reference in New Issue
Block a user