Hi all,
How can we get the list of all users having a specific role in the python class?
Thanks in advance for the answers…
Hi all,
How can we get the list of all users having a specific role in the python class?
Thanks in advance for the answers…
Until frappe7
frappe.db.sql("SELECT DISTINCT parent FROM `tabUser Role` WHERE role=%s", ("System Manager",))
In frappe8
frappe.db.sql("SELECT DISTINCT parent FROM `tabHas Role` WHERE role=%s", ("System Manager",))
Thanks @max_morais_dmm
frappe.db.sql(“SELECT DISTINCT parent FROM
tabUserRole
WHERE role=%s”, (“System Manager”,))
this works
We can find the frappe version with frappe.__version__
right?