Project Users role not required to add user to the project
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 1b3b05d..bb9e1fd 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -22,6 +22,12 @@
}
frm.set_query('customer', 'erpnext.controllers.queries.customer_query');
+
+ frm.set_query("user", "users", function() {
+ return {
+ query:"erpnext.projects.doctype.project.project.get_users_for_project"
+ }
+ });
// sales order
frm.set_query('sales_order', function() {
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 7405f2c..f5ff2de 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -187,6 +187,13 @@
"row_template": "templates/includes/projects/project_row.html"
}
+def get_users_for_project(doctype, txt, searchfield, start, page_len, filters):
+ return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
+ from `tabUser`
+ where enabled=1
+ and name not in ("Guest", "Administrator")
+ order by
+ name asc""")
@frappe.whitelist()
def get_cost_center_name(project):