[v7] Pulling custom field into Salary Slip

Hi,

I have a custom field called Category in the Salary Detail doctype.

I need to fetch the category(s) from the Salary Detail table in Salary Structure into that in Salary Slip. This works fine when I ‘Make’ a Salary Slip from Salary Structure. However, kindly advice how I can pull this custom field, when I create a ‘New’ Salary Slip.

Thank you.

Hi @fachristy,

Keep fieldname category on both salary structure and salary slip doctype and “No Copy” property of the field must be unchecked.

Thanks, Rohit

Hi @rohit_w,

We do have the field ‘Category’ unchecked as ‘No Copy’ in Salary Detail table.
It is able to fetch when we make Salary Slip from Salary Structure via ‘Make Salary Slip’. However, when we create a ‘New’ Salary Slip, not being brought forward.

Thank you.

Hi,

We have discovered that it is because Salary Slip does the following :
> def pull_sal_struct(self, struct):
> from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
> make_salary_slip(struct, self)

And at make_salary_slip, has a new criteria - ignore_child_tables=True at the following line :
https://github.com/frappe/erpnext/blob/develop/erpnext/hr/doctype/salary_structure/salary_structure.py#L120

Thus, our custom field is not brought forward when Salary Slip is populated.
Kindly advice how we can overcome this.

Thank you.