frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
20.48k stars 7.09k forks source link

Wrong employee id is filled in employee link field of the form when employee filter is applied in list view. #25780

Closed nikhilponnuru closed 3 years ago

nikhilponnuru commented 3 years ago

Description of the issue

Employee link field of the form is picking employee id from employee filter in the list view.

This issue can be best described by steps:

Step1: Login (here say the logged in employee is HR-EMP-00002)

Step2: Apply an employee filter in the list view of any of the modules like leave application, expense claim etc.

Here the filter applied is for HR-EMP-00001

image

Step 3: Click on 'Add Leave Application'

Step 4: See that employee field below is filled with details of HR-EMP-00001 from filters but not based on the logged in employee. (i.e HR-EMP-00002 is logged in)

image

Context information (for bug reports)

Output of bench version

erpnext 13.2.0
frappe 13.2.0

Steps to reproduce the issue

  1. As described above

Observed result

Wrong employee details are filled in leave application, expense claim etc.. wherever employee link field is used and a filter of another employee is applied in the list view.

Expected result

Correct employee details to be shown in every module.

Stacktrace / full error message

(paste here)

Additional information

OS version / distribution, Frappe install method, etc.

Mac os, mojave.

nabinhait commented 3 years ago

@nikhilponnuru This is the expected behaviour in the frappe framework. If you filter on a link field in List view and then try to create a new record, the system set the default value of the link field based on the filter value. Here, the system expects that you are processing data for the employee which has been set in the filter.

Closing this.