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:
parent
d66396f4e9
commit
06a0afa039
@ -211,6 +211,38 @@
|
|||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 1,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "notify_users_by_email",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Notify users by email",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
"allow_in_quick_entry": 0,
|
"allow_in_quick_entry": 0,
|
||||||
@ -548,7 +580,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-08-21 16:15:55.968224",
|
"modified": "2019-08-01 16:15:55.968224",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Onboarding",
|
"name": "Employee Onboarding",
|
||||||
|
@ -29,6 +29,9 @@ class EmployeeOnboarding(EmployeeBoardingController):
|
|||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
super(EmployeeOnboarding, self).on_submit()
|
super(EmployeeOnboarding, self).on_submit()
|
||||||
|
|
||||||
|
def on_update_after_submit(self):
|
||||||
|
self.create_task_and_notify_user()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
super(EmployeeOnboarding, self).on_cancel()
|
super(EmployeeOnboarding, self).on_cancel()
|
||||||
|
|
||||||
|
@ -147,38 +147,41 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_in_quick_entry": 0,
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_in_quick_entry": 0,
|
||||||
"bold": 0,
|
"allow_on_submit": 1,
|
||||||
"collapsible": 0,
|
"bold": 0,
|
||||||
"columns": 0,
|
"collapsible": 0,
|
||||||
"fieldname": "project",
|
"columns": 0,
|
||||||
"fieldtype": "Link",
|
"fieldname": "notify_users_by_email",
|
||||||
"hidden": 0,
|
"fieldtype": "Check",
|
||||||
"ignore_user_permissions": 0,
|
"hidden": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_user_permissions": 0,
|
||||||
"in_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_global_search": 0,
|
||||||
"in_standard_filter": 0,
|
"in_list_view": 0,
|
||||||
"label": "Project",
|
"in_standard_filter": 0,
|
||||||
"length": 0,
|
"label": "Notify users by email",
|
||||||
"no_copy": 0,
|
"length": 0,
|
||||||
"options": "Project",
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
"allow_in_quick_entry": 0,
|
"allow_in_quick_entry": 0,
|
||||||
@ -277,6 +280,39 @@
|
|||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "project",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Project",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Project",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
"allow_in_quick_entry": 0,
|
"allow_in_quick_entry": 0,
|
||||||
@ -550,7 +586,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-08-21 16:15:39.025898",
|
"modified": "2019-08-03 16:15:39.025898",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Separation",
|
"name": "Employee Separation",
|
||||||
|
@ -12,5 +12,8 @@ class EmployeeSeparation(EmployeeBoardingController):
|
|||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
super(EmployeeSeparation, self).on_submit()
|
super(EmployeeSeparation, self).on_submit()
|
||||||
|
|
||||||
|
def on_update_after_submit(self):
|
||||||
|
self.create_task_and_notify_user()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
super(EmployeeSeparation, self).on_cancel()
|
super(EmployeeSeparation, self).on_cancel()
|
||||||
|
@ -36,12 +36,18 @@ class EmployeeBoardingController(Document):
|
|||||||
}).insert(ignore_permissions=True)
|
}).insert(ignore_permissions=True)
|
||||||
self.db_set("project", project.name)
|
self.db_set("project", project.name)
|
||||||
self.db_set("boarding_status", "Pending")
|
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
|
# create the task for the given project and assign to the concerned person
|
||||||
for activity in self.activities:
|
for activity in self.activities:
|
||||||
|
if activity.task:
|
||||||
|
continue
|
||||||
|
|
||||||
task = frappe.get_doc({
|
task = frappe.get_doc({
|
||||||
"doctype": "Task",
|
"doctype": "Task",
|
||||||
"project": project.name,
|
"project": self.project,
|
||||||
"subject": activity.activity_name + " : " + self.employee_name,
|
"subject": activity.activity_name + " : " + self.employee_name,
|
||||||
"description": activity.description,
|
"description": activity.description,
|
||||||
"department": self.department,
|
"department": self.department,
|
||||||
@ -69,6 +75,7 @@ class EmployeeBoardingController(Document):
|
|||||||
'doctype' : task.doctype,
|
'doctype' : task.doctype,
|
||||||
'name' : task.name,
|
'name' : task.name,
|
||||||
'description' : task.description or task.subject,
|
'description' : task.description or task.subject,
|
||||||
|
'notify': self.notify_users_by_email
|
||||||
}
|
}
|
||||||
assign_to.add(args)
|
assign_to.add(args)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user