[Minor] Job Offer UX improvise (#15042)
* job offer ux improv * Update job_offer.js
This commit is contained in:
parent
cce7c5c245
commit
6004b66797
@ -13,13 +13,22 @@ frappe.ui.form.on("Job Offer", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
if ((!frm.doc.__islocal) && (frm.doc.status == 'Accepted') && (frm.doc.docstatus === 1)) {
|
if ((!frm.doc.__islocal) && (frm.doc.status == 'Accepted')
|
||||||
|
&& (frm.doc.docstatus === 1) && (!frm.doc.__onload.employee)) {
|
||||||
frm.add_custom_button(__('Make Employee'),
|
frm.add_custom_button(__('Make Employee'),
|
||||||
function () {
|
function () {
|
||||||
erpnext.job_offer.make_employee(frm);
|
erpnext.job_offer.make_employee(frm);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(frm.doc.__onload.employee) {
|
||||||
|
frm.add_custom_button(__('Show Employee'),
|
||||||
|
function () {
|
||||||
|
frappe.set_route("Form", "Employee", frm.doc.__onload.employee);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,7 +7,9 @@ from frappe.model.document import Document
|
|||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
|
||||||
class JobOffer(Document):
|
class JobOffer(Document):
|
||||||
pass
|
def onload(self):
|
||||||
|
employee = frappe.db.get_value("Employee", {"job_applicant": self.job_applicant}, "name") or ""
|
||||||
|
self.set_onload("employee", employee)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_employee(source_name, target_doc=None):
|
def make_employee(source_name, target_doc=None):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user