mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
Added Is Active to Sales Person
This commit is contained in:
@@ -58,6 +58,15 @@ frappe.ui.form.on('Employee',{
|
||||
},
|
||||
update_contact:function(frm){
|
||||
frm.set_value("prefered_email",frm.fields_dict[frappe.model.scrub(frm.doc.prefered_contact_email)].value)
|
||||
}
|
||||
},
|
||||
status: function(frm) {
|
||||
return frm.call({
|
||||
method: "deactivate_sales_person",
|
||||
args: {
|
||||
employee: frm.doc.employee,
|
||||
status: frm.doc.status
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
cur_frm.cscript = new erpnext.hr.EmployeeController({frm: cur_frm});
|
||||
|
||||
@@ -244,3 +244,9 @@ def is_holiday(employee, date=None):
|
||||
if holiday_list:
|
||||
return frappe.get_all('Holiday List', dict(name=holiday_list, holiday_date=date)) and True or False
|
||||
|
||||
@frappe.whitelist()
|
||||
def deactivate_sales_person(status = None, employee = None):
|
||||
if status == "Left":
|
||||
sales_person = frappe.db.get_value("Sales Person", {"Employee": employee})
|
||||
if sales_person:
|
||||
frappe.db.set_value("Sales Person", sales_person, "enabled", 0)
|
||||
|
||||
Reference in New Issue
Block a user