fix: show Exit Questionnaire button only to the users with write access
- fix linter issues
This commit is contained in:
parent
3230741cde
commit
0a937dc050
@ -3,7 +3,7 @@
|
||||
|
||||
frappe.ui.form.on('Exit Interview', {
|
||||
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.trigger('send_exit_questionnaire');
|
||||
});
|
||||
|
@ -28,9 +28,9 @@ class ExitInterview(Document):
|
||||
'docstatus': ('!=', 2)
|
||||
})
|
||||
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)),
|
||||
title=_('Duplicate Document'))
|
||||
frappe.DuplicateEntryError)
|
||||
|
||||
def set_employee_email(self):
|
||||
employee = frappe.get_doc('Employee', self.employee)
|
||||
|
@ -4,5 +4,6 @@
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestExitInterview(unittest.TestCase):
|
||||
pass
|
||||
|
@ -1,4 +1,5 @@
|
||||
import frappe
|
||||
# import frappe
|
||||
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
|
@ -91,8 +91,6 @@ def get_columns():
|
||||
]
|
||||
|
||||
def get_data(filters):
|
||||
data = []
|
||||
|
||||
employee = frappe.qb.DocType('Employee')
|
||||
interview = frappe.qb.DocType('Exit Interview')
|
||||
fnf = frappe.qb.DocType('Full and Final Statement')
|
||||
|
Loading…
Reference in New Issue
Block a user