mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix: show Exit Questionnaire button only to the users with write access
- fix linter issues
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Exit Interview', {
|
frappe.ui.form.on('Exit Interview', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if (!frm.doc.__islocal && !frm.doc.questionnaire_email_sent) {
|
if (!frm.doc.__islocal && !frm.doc.questionnaire_email_sent && frappe.boot.user.can_write.includes('Exit Interview')) {
|
||||||
frm.add_custom_button(__('Send Exit Questionnaire'), function () {
|
frm.add_custom_button(__('Send Exit Questionnaire'), function () {
|
||||||
frm.trigger('send_exit_questionnaire');
|
frm.trigger('send_exit_questionnaire');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class ExitInterview(Document):
|
|||||||
'docstatus': ('!=', 2)
|
'docstatus': ('!=', 2)
|
||||||
})
|
})
|
||||||
if doc:
|
if doc:
|
||||||
frappe.throw(_('Exit Interview {0} already scheduled for Employee: {1}').format(
|
frappe.throw(_('Exit Interview {0} already exists for Employee: {1}').format(
|
||||||
get_link_to_form('Exit Interview', doc), frappe.bold(self.employee)),
|
get_link_to_form('Exit Interview', doc), frappe.bold(self.employee)),
|
||||||
title=_('Duplicate Document'))
|
frappe.DuplicateEntryError)
|
||||||
|
|
||||||
def set_employee_email(self):
|
def set_employee_email(self):
|
||||||
employee = frappe.get_doc('Employee', self.employee)
|
employee = frappe.get_doc('Employee', self.employee)
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
# import frappe
|
# import frappe
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class TestExitInterview(unittest.TestCase):
|
class TestExitInterview(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import frappe
|
# import frappe
|
||||||
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -91,8 +91,6 @@ def get_columns():
|
|||||||
]
|
]
|
||||||
|
|
||||||
def get_data(filters):
|
def get_data(filters):
|
||||||
data = []
|
|
||||||
|
|
||||||
employee = frappe.qb.DocType('Employee')
|
employee = frappe.qb.DocType('Employee')
|
||||||
interview = frappe.qb.DocType('Exit Interview')
|
interview = frappe.qb.DocType('Exit Interview')
|
||||||
fnf = frappe.qb.DocType('Full and Final Statement')
|
fnf = frappe.qb.DocType('Full and Final Statement')
|
||||||
|
|||||||
Reference in New Issue
Block a user