mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
feat: added for disabling leave notification in HR settings
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
"stop_birthday_reminders",
|
"stop_birthday_reminders",
|
||||||
"expense_approver_mandatory_in_expense_claim",
|
"expense_approver_mandatory_in_expense_claim",
|
||||||
"leave_settings",
|
"leave_settings",
|
||||||
|
"send_leave_notification",
|
||||||
"leave_approval_notification_template",
|
"leave_approval_notification_template",
|
||||||
"leave_status_notification_template",
|
"leave_status_notification_template",
|
||||||
"role_allowed_to_create_backdated_leave_application",
|
"role_allowed_to_create_backdated_leave_application",
|
||||||
@@ -69,15 +70,19 @@
|
|||||||
"label": "Leave Settings"
|
"label": "Leave Settings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval: doc.send_leave_notification == 1",
|
||||||
"fieldname": "leave_approval_notification_template",
|
"fieldname": "leave_approval_notification_template",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Leave Approval Notification Template",
|
"label": "Leave Approval Notification Template",
|
||||||
|
"mandatory_depends_on": "eval: doc.send_leave_notification == 1",
|
||||||
"options": "Email Template"
|
"options": "Email Template"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval: doc.send_leave_notification == 1",
|
||||||
"fieldname": "leave_status_notification_template",
|
"fieldname": "leave_status_notification_template",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Leave Status Notification Template",
|
"label": "Leave Status Notification Template",
|
||||||
|
"mandatory_depends_on": "eval: doc.send_leave_notification == 1",
|
||||||
"options": "Email Template"
|
"options": "Email Template"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -132,13 +137,19 @@
|
|||||||
"fieldname": "automatically_allocate_leaves_based_on_leave_policy",
|
"fieldname": "automatically_allocate_leaves_based_on_leave_policy",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Automatically Allocate Leaves Based On Leave Policy"
|
"label": "Automatically Allocate Leaves Based On Leave Policy"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "send_leave_notification",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Send Leave Notification"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-02-25 12:31:14.947865",
|
"modified": "2021-03-14 02:04:22.907159",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "HR Settings",
|
"name": "HR Settings",
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class LeaveApplication(Document):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
if self.status == "Open" and self.docstatus < 1:
|
if self.status == "Open" and self.docstatus < 1:
|
||||||
# notify leave approver about creation
|
# notify leave approver about creation
|
||||||
|
if frappe.db.get_single_value("HR Settings", "send_leave_notification"):
|
||||||
self.notify_leave_approver()
|
self.notify_leave_approver()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user