fix: Change name to Allow Account Creation against Child Company in company master

This commit is contained in:
deepeshgarg007 2019-03-26 17:18:06 +05:30
parent c45c2bdabb
commit 3eeb1cacb0
3 changed files with 7 additions and 8 deletions

View File

@ -96,11 +96,10 @@ class Account(NestedSet):
if frappe.local.flags.ignore_root_company_validation or self.flags.ignore_root_company_validation: if frappe.local.flags.ignore_root_company_validation or self.flags.ignore_root_company_validation:
return return
if frappe.get_value("Company", self.company, "ignore_root_company_validation"):
return
ancestors = get_root_company(self.company) ancestors = get_root_company(self.company)
if ancestors: if ancestors:
if frappe.get_value("Company", self.company, "allow_account_creation_against_child_company"):
return
frappe.throw(_("Please add the account to root level Company - %s" % ancestors[0])) frappe.throw(_("Please add the account to root level Company - %s" % ancestors[0]))
else: else:
descendants = get_descendants_of('Company', self.company) descendants = get_descendants_of('Company', self.company)

View File

@ -24,8 +24,8 @@ frappe.treeview_settings["Account"] = {
let root_company = r.message.length ? r.message[0] : ""; let root_company = r.message.length ? r.message[0] : "";
me.page.fields_dict.root_company.set_value(root_company); me.page.fields_dict.root_company.set_value(root_company);
frappe.db.get_value("Company", {"name": company}, "ignore_root_company_validation", (r) => { frappe.db.get_value("Company", {"name": company}, "allow_account_creation_against_child_company", (r) => {
frappe.flags.ignore_root_company_validation = r.ignore_root_company_validation; frappe.flags.ignore_root_company_validation = r.allow_account_creation_against_child_company;
}); });
} }
} }

View File

@ -1466,7 +1466,7 @@
"columns": 0, "columns": 0,
"depends_on": "eval:doc.parent_company", "depends_on": "eval:doc.parent_company",
"fetch_if_empty": 0, "fetch_if_empty": 0,
"fieldname": "ignore_root_company_validation", "fieldname": "allow_account_creation_against_child_company",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
@ -1475,7 +1475,7 @@
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Ignore Root Company Validation", "label": "Allow Account Creation Against Child Company",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
@ -3093,7 +3093,7 @@
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"menu_index": 0, "menu_index": 0,
"modified": "2019-03-25 22:13:08.721452", "modified": "2019-03-26 17:15:50.390548",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Company", "name": "Company",