Feat: Notify by email feature (#18587)

* feat: notify user by email in employee onboarding control

* fix: create task on update after submit
This commit is contained in:
Mangesh-Khairnar
2019-08-05 10:07:05 +05:30
committed by Nabin Hait
parent d66396f4e9
commit 06a0afa039
5 changed files with 120 additions and 39 deletions

View File

@@ -36,12 +36,18 @@ class EmployeeBoardingController(Document):
}).insert(ignore_permissions=True)
self.db_set("project", project.name)
self.db_set("boarding_status", "Pending")
self.reload()
self.create_task_and_notify_user()
def create_task_and_notify_user(self):
# create the task for the given project and assign to the concerned person
for activity in self.activities:
if activity.task:
continue
task = frappe.get_doc({
"doctype": "Task",
"project": project.name,
"project": self.project,
"subject": activity.activity_name + " : " + self.employee_name,
"description": activity.description,
"department": self.department,
@@ -69,6 +75,7 @@ class EmployeeBoardingController(Document):
'doctype' : task.doctype,
'name' : task.name,
'description' : task.description or task.subject,
'notify': self.notify_users_by_email
}
assign_to.add(args)