mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
[merge] merge with master
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
$.extend(cur_frm.cscript, {
|
||||
refresh: function(doc) {
|
||||
|
||||
wn.provide("erpnext.projects");
|
||||
|
||||
erpnext.projects.TimeLog = wn.ui.form.Controller.extend({
|
||||
setup: function() {
|
||||
this.frm.set_query("task", erpnext.queries.task);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
cur_frm.cscript = new erpnext.projects.TimeLog({frm: cur_frm});
|
||||
@@ -5,4 +5,25 @@ import webnotes
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_time_log_list(doctype, txt, searchfield, start, page_len, filters):
|
||||
return webnotes.conn.get_values("Time Log", filters, ["name", "activity_type", "owner"])
|
||||
return webnotes.conn.get_values("Time Log", filters, ["name", "activity_type", "owner"])
|
||||
|
||||
@webnotes.whitelist()
|
||||
def query_task(doctype, txt, searchfield, start, page_len, filters):
|
||||
from webnotes.widgets.reportview import build_match_conditions
|
||||
|
||||
search_string = "%%%s%%" % txt
|
||||
order_by_string = "%s%%" % txt
|
||||
match_conditions = build_match_conditions("Task")
|
||||
match_conditions = ("and" + match_conditions) if match_conditions else ""
|
||||
|
||||
return webnotes.conn.sql("""select name, subject from `tabTask`
|
||||
where (`%s` like %s or `subject` like %s) %s
|
||||
order by
|
||||
case when `subject` like %s then 0 else 1 end,
|
||||
case when `%s` like %s then 0 else 1 end,
|
||||
`%s`,
|
||||
subject
|
||||
limit %s, %s""" %
|
||||
(searchfield, "%s", "%s", match_conditions, "%s",
|
||||
searchfield, "%s", searchfield, "%s", "%s"),
|
||||
(search_string, search_string, order_by_string, order_by_string, start, page_len))
|
||||
Reference in New Issue
Block a user