Create additional salary in another site

Hi, i am currently need to make a custom where i create “work order” and then save it, it will automatically create an additional salary but in different site. The problem is that i already develop the code but got this error

File "/home/frappe/frappe-bench/apps/erpnext/erpnext/payroll/doctype/a [“dste_of_joining”, “relieving_date”]) TypeError: ‘NoneType’ object is not iterable.

is anyone understand what to do with this error? thanks a lot