fix: amend cancelled job offer (#24589)

This commit is contained in:
Afshan 2021-02-11 11:05:48 +05:30 committed by GitHub
parent df6e20887d
commit 8609d31430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ class JobOffer(Document):
def validate(self):
self.validate_vacancies()
job_offer = frappe.db.exists("Job Offer",{"job_applicant": self.job_applicant})
job_offer = frappe.db.exists("Job Offer",{"job_applicant": self.job_applicant, "docstatus": ["!=", 2]})
if job_offer and job_offer != self.name:
frappe.throw(_("Job Offer: {0} is already for Job Applicant: {1}").format(frappe.bold(job_offer), frappe.bold(self.job_applicant)))