Error while creating Salary Slip while running Payroll entry

Hi,
I’m getting an error below while running payroll. Actually wanted to create salary slip from payroll run. Appreciate your help and support.

File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py”, line 16, in on_submit
self.create_salary_slips()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py”, line 117, in create_salary_slips
create_salary_slips_for_employees(emp_list, args, publish_progress=False)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py”, line 495, in create_salary_slips_for_employees
ss.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 46, in validate
self.get_emp_and_leave_details()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 132, in get_emp_and_leave_details
self.pull_sal_struct()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 182, in pull_sal_struct
make_salary_slip(self._salary_structure_doc.name, self)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py”, line 160, in make_salary_slip
}, target_doc, postprocess, ignore_child_tables=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/mapper.py”, line 113, in get_mapped_doc
postprocess(source_doc, target_doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py”, line 150, in postprocess
target.run_method(‘process_salary_structure’, for_preview=for_preview)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 813, in process_salary_structure
self.calculate_net_pay()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 290, in calculate_net_pay
self.calculate_component_amounts()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 310, in calculate_component_amounts
self.set_component_amounts_based_on_payment_days()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 733, in set_component_amounts_based_on_payment_days
d.amount = self.get_amount_based_on_payment_days(d, joining_date, relieving_date)[0]
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 617, in get_amount_based_on_payment_days
amount = row.default_amount + row.additional_amount
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘NoneType’

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1032, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 848, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 837, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 313, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 908, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py”, line 16, in on_submit
self.create_salary_slips()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py”, line 117, in create_salary_slips
create_salary_slips_for_employees(emp_list, args, publish_progress=False)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py”, line 495, in create_salary_slips_for_employees
ss.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 46, in validate
self.get_emp_and_leave_details()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 132, in get_emp_and_leave_details
self.pull_sal_struct()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 182, in pull_sal_struct
make_salary_slip(self._salary_structure_doc.name, self)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py”, line 160, in make_salary_slip
}, target_doc, postprocess, ignore_child_tables=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/mapper.py”, line 113, in get_mapped_doc
postprocess(source_doc, target_doc)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py”, line 150, in postprocess
target.run_method(‘process_salary_structure’, for_preview=for_preview)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 813, in process_salary_structure
self.calculate_net_pay()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 290, in calculate_net_pay
self.calculate_component_amounts()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 310, in calculate_component_amounts
self.set_component_amounts_based_on_payment_days()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 733, in set_component_amounts_based_on_payment_days
d.amount = self.get_amount_based_on_payment_days(d, joining_date, relieving_date)[0]
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 617, in get_amount_based_on_payment_days
amount = row.default_amount + row.additional_amount
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘NoneType’

did you make any changes to the code?

Nope.

Hi,

If you haven’t made any customizations and using the feature as it is, then would recommend to try out the process again. Unfortunately can’t help you with the traceback error but can definitely help you with the process. Kindly see the below link and follow:
https://frappe.erpnext.com/kb/hr/payroll-process

Regards,
Reema

Is there any updated link for the documentation that you provided? I wanted to know the payroll process.

Check this Not Found

Other similar articles: HR

You can also refer the Payroll section at Human Resources

1 Like

Although, I am familiar with the latter documentation for erp-next. Didn’t know frappe docs would have similar things too.

Thanks a ton!

1 Like