mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 20:49:19 +00:00
[docs] [setup] cleanup
This commit is contained in:
@@ -35,9 +35,9 @@ class DocType(DocTypeNestedSet):
|
||||
if not self.doc.group_or_ledger:
|
||||
msgprint("Please select Group or Ledger value", raise_exception=1)
|
||||
|
||||
if self.doc.cost_center_name != 'Root' and not self.doc.parent_cost_center:
|
||||
if self.doc.cost_center_name != self.doc.company_name and not self.doc.parent_cost_center:
|
||||
msgprint("Please enter parent cost center", raise_exception=1)
|
||||
elif self.doc.cost_center_name == "Root" and self.doc.parent_cost_center:
|
||||
elif self.doc.cost_center_name == self.doc.company_name and self.doc.parent_cost_center:
|
||||
msgprint(_("Root cannot have a parent cost center"), raise_exception=1)
|
||||
|
||||
def convert_group_to_ledger(self):
|
||||
|
||||
@@ -117,7 +117,7 @@ erpnext.AccountsChart = Class.extend({
|
||||
me.company = company;
|
||||
this.tree = new wn.ui.Tree({
|
||||
parent: $(wrapper),
|
||||
label: company,
|
||||
label: ctype==="Account" ? "Accounts" : "Cost Centers",
|
||||
args: {ctype: ctype, comp: company},
|
||||
method: 'accounts.page.accounts_browser.accounts_browser.get_children',
|
||||
click: function(link) {
|
||||
|
||||
@@ -31,14 +31,14 @@ def get_children():
|
||||
company_field = ctype=='Account' and 'company' or 'company_name'
|
||||
|
||||
# root
|
||||
if args['parent'] == company:
|
||||
if args['parent'] in ("Accounts", "Cost Centers"):
|
||||
acc = webnotes.conn.sql(""" select
|
||||
name as value, if(group_or_ledger='Group', 1, 0) as expandable
|
||||
from `tab%s`
|
||||
where ifnull(parent_%s,'') = ''
|
||||
and %s = %s and docstatus<2
|
||||
order by name""" % (ctype, ctype.lower().replace(' ','_'), company_field, '%s'),
|
||||
args['parent'], as_dict=1)
|
||||
company, as_dict=1)
|
||||
else:
|
||||
# other
|
||||
acc = webnotes.conn.sql("""select
|
||||
|
||||
Reference in New Issue
Block a user