in this project 4 employee there so it should visible to him only
but it is visible to others who is not in project
from role permission i removed but when i am giving role project user then he is also able to see others projects
in this project 4 employee there so it should visible to him only
but it is visible to others who is not in project
from role permission i removed but when i am giving role project user then he is also able to see others projects
Hi @Jeel i am writing this script but its not working
could you please suggest any correct script or can you modify my script
import frappe
from frappe.utils import flt
def get_permission_query_conditions(user):
if not user:
user = frappe.session.user
if "Employee" in frappe.get_roles(user):
employee = frappe.get_value("Employee", {"user_id": user}, "name")
if employee:
return f"""(`tabProject`.name IN (
SELECT DISTINCT `tabProject Assignment`.parent
FROM `tabProject Assignment`
WHERE `tabProject Assignment`.employee = '{employee}'
))"""
else:
return ""
def has_permission(doc, user):
if “Employee” in frappe.get_roles(user):
employee = frappe.get_value(“Employee”, {“user_id”: user}, “name”)
if employee:
project_assignments = frappe.get_all(“Project Assignment”,
filters={“parent”: doc.name,
“employee”: employee})
return bool(project_assignments)
return True
@Prashanth_Kolhetkar please assign project to user from sidebar there is one assign to button click on this button and assign project to user