fix(minor): chart of accounts sorting and message

This commit is contained in:
Rushabh Mehta 2019-05-01 13:53:05 +05:30
parent 1efade3408
commit 43958dcd11
3 changed files with 5 additions and 2 deletions

View File

@ -334,6 +334,9 @@ def sort_accounts(accounts, is_root=False, key="name"):
if re.split('\W+', a[key])[0].isdigit(): if re.split('\W+', a[key])[0].isdigit():
# if chart of accounts is numbered, then sort by number # if chart of accounts is numbered, then sort by number
return cmp(a[key], b[key]) return cmp(a[key], b[key])
else:
# common, this should be alphabetic otherwise!
return cmp(a[key], b[key])
return 1 return 1
accounts.sort(key = functools.cmp_to_key(compare_accounts)) accounts.sort(key = functools.cmp_to_key(compare_accounts))

View File

@ -3,7 +3,7 @@ frappe.listview_settings['Project'] = {
filters:[["status","=", "Open"]], filters:[["status","=", "Open"]],
get_indicator: function(doc) { get_indicator: function(doc) {
if(doc.status=="Open" && doc.percent_complete) { if(doc.status=="Open" && doc.percent_complete) {
return [__("{0}% Complete", [cint(doc.percent_complete)]), "orange", "percent_complete,>,0|status,=,Open"]; return [__("{0}%", [cint(doc.percent_complete)]), "orange", "percent_complete,>,0|status,=,Open"];
} else { } else {
return [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status]; return [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
} }

View File

@ -48,7 +48,7 @@ class Task(NestedSet):
if self.status!=self.get_db_value("status") and self.status == "Completed": if self.status!=self.get_db_value("status") and self.status == "Completed":
for d in self.depends_on: for d in self.depends_on:
if frappe.db.get_value("Task", d.task, "status") != "Completed": if frappe.db.get_value("Task", d.task, "status") != "Completed":
frappe.throw(_("Cannot close task as its dependant task {0} is not closed.").format(d.task)) frappe.throw(_("Cannot close task {0} as its dependant task {1} is not closed.").format(frappe.bold(self.name), frappe.bold(d.task)))
from frappe.desk.form.assign_to import clear from frappe.desk.form.assign_to import clear
clear(self.doctype, self.name) clear(self.doctype, self.name)