Server Error AttributeError: 'EmployeeMaster' object has no attribute 'job_applicant'

Server Error: AttributeError: ‘EmployeeMaster’ object has no attribute ‘job_applicant’

i am facing this error when creating a new employee :

I tired with this solution :and still the same error i tried reinstalling Hrms, changing version, updating the bench, I tried adding a custom field in the employee doctype with name job_applicant i made it a link field and still the same error
I also changed the code if not doc.job_applicant: to if not hasattr(doc, ‘job_applicant’) or not doc.job_applicant: in the employee_master.py
and still the same error.

Installed Apps
ERPNext: v14.74.3 (version-14)
Frappe Framework: v14.82.0 (version-14)
Frappe HR: v14.33.0 (version-14)
India Compliance: v14.30.5 (version-14)
POS Awesome: v6.3.0 (develop)

It would have been great if you guys could help me out. :slight_smile:

Can you please copy the error and share it so it will be easy to look into?

1 Like

Here

App Versions

{
	"erpnext": "14.74.3",
	"frappe": "14.82.0",
	"hrms": "14.33.0",
	"india_compliance": "14.30.5",
	"posawesome": "6.3.0"
}

Route

Form/Employee/new-employee-wsyxehwkur

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 97, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 48, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 31, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 310, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 332, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 265, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1061, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 931, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1283, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1267, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
  File "apps/hrms/hrms/overrides/employee_master.py", line 31, in validate_onboarding_process
    if not doc.job_applicant:
AttributeError: 'EmployeeMaster' object has no attribute 'job_applicant'

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"docstatus\":0,\"doctype\":\"Employee\",\"name\":\"new-employee-wsyxehwkur\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"naming_series\":\"HR-EMP-\",\"status\":\"Active\",\"create_user_permission\":1,\"company\":\"RV Solution\",\"prefered_contact_email\":\"\",\"unsubscribed\":0,\"current_accommodation_type\":\"\",\"permanent_accommodation_type\":\"\",\"salary_currency\":\"INR\",\"salary_mode\":\"\",\"marital_status\":\"\",\"blood_group\":\"\",\"leave_encashed\":\"\",\"first_name\":\"sss\",\"date_of_birth\":\"2004-02-19\",\"date_of_retirement\":\"2064-02-19\",\"gender\":\"Female\",\"date_of_joining\":\"2023-05-17\",\"custom_job_applicant\":\"sadashiv@myrvsolution.com\"}",
		"action": "Save"
	},
	"btn": {
		"jQuery3600103128124402098731": {
			"events": {
				"click": [
					{
						"type": "click",
						"origType": "click",
						"guid": 8720,
						"namespace": ""
					}
				]
			}
		}
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.save.savedocs"
}

Response Data

{
	"exception": "AttributeError: 'EmployeeMaster' object has no attribute 'job_applicant'"
}


As I can see in your error log, the “job_applicant” field is renamed to “custom_job_applicant,” so in my opinion, this is causing the issue. Have you done any customization to your Employee Doctype?

This is orignal job_applicant field in Employee

I was not able to see the Job applicant field so i tried creating it but later i removed as it not working

i m not able to see the original job_applicant field in Employee

Check via the customized form because I can see that field code is available in the HRMS setup.py file.

also try updating your site using bench update command

1 Like

Thank you for your help! I have successfully uninstalled the HRMS app, cleared the data, and reinstalled it. Additionally, I updated the site using the bench update command. If I have any questions or need further guidance in the future, I will kindly reach out to you. :smiley:

1 Like