Project Users role not required to add user to the project

This commit is contained in:
Kanchan Chauhan 2016-08-04 14:21:20 +05:30
parent 51a593b0b5
commit 58bc00f954
2 changed files with 13 additions and 0 deletions

View File

@ -22,6 +22,12 @@ frappe.ui.form.on("Project", {
} }
frm.set_query('customer', 'erpnext.controllers.queries.customer_query'); 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 // sales order
frm.set_query('sales_order', function() { frm.set_query('sales_order', function() {

View File

@ -187,6 +187,13 @@ def get_list_context(context=None):
"row_template": "templates/includes/projects/project_row.html" "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() @frappe.whitelist()
def get_cost_center_name(project): def get_cost_center_name(project):