-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_count api error for list view #22917
Comments
Query should be this 😅 Count is somehow getting removed. |
If you can debug code check what's happening here: frappe/frappe/desk/reportview.py Lines 111 to 113 in e203699
|
I have checked it and logged all fieldname before entering in first if and data after executing if chain. When I access Job Applicant from admin and when I access Job Applicant as assigned to interviewer, In both case output will remain same so, I don't think, it is affecting query. |
I have observe that count field is removed from db_query.py -> apply_fieldlevel_read_permissions() function. It is calling get_permitted_fields() from frappe/model/init.py file and return [] box. So, that count query is getting removed. Flow -> reportview.py file's get_count() is called -> it will call execute and it will call db_query.py file's execute() method -> execute() call build_and_run() -> prepare_args() -> it's first 5 function's last 5th line function apply_fieldlevel_read_permissions() -> It will call frappe/model/init.py's get_permitted_fields() and it will return [] so, count query is getting removed |
Description of the issue
When non authorize person see list this error comes.
For Ex. As an HR i have assigned and share Job Applicant to some interviewer. Then interviewer should able to see that Job Applicant. But as interviewer open Job Applicant List it see that Job Applicant but error come for sql query as shown in below image.
It should happen same for all documents. If I assign interview to some employee, so employee now able to see that interview but in list view it shows sql query error for get_count
I am using version-15
This issue doctypes are from hrms but this is happening because of frappe/model/db_query.py. I don't know exact reason, but in version-14 code it work fine. Error comes in version-15
Context information (for bug reports)
Output of
bench version
Steps to reproduce the issue
Observed result
Expected result
Stacktrace / full error message
Additional information
OS version / distribution,
Frappe
install method, etc.The text was updated successfully, but these errors were encountered: