Parent account mandatory for all non-root accounts
This commit is contained in:
parent
9198444a3b
commit
bc7efa6da6
@ -80,6 +80,7 @@
|
|||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
|
"reqd": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -209,7 +210,7 @@
|
|||||||
"icon": "icon-money",
|
"icon": "icon-money",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"modified": "2014-05-21 11:42:47.255511",
|
"modified": "2014-06-03 18:27:58.109303",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Account",
|
"name": "Account",
|
||||||
|
@ -91,6 +91,8 @@ class Company(Document):
|
|||||||
|
|
||||||
for d in self.fld_dict.keys():
|
for d in self.fld_dict.keys():
|
||||||
account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]])
|
account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]])
|
||||||
|
if not account.parent_account:
|
||||||
|
account.ignore_mandatory = True
|
||||||
account.insert()
|
account.insert()
|
||||||
|
|
||||||
def set_default_accounts(self):
|
def set_default_accounts(self):
|
||||||
|
@ -38,8 +38,7 @@ class Warehouse(Document):
|
|||||||
def create_account_head(self):
|
def create_account_head(self):
|
||||||
if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
|
if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
|
||||||
if not frappe.db.get_value("Account", {"account_type": "Warehouse",
|
if not frappe.db.get_value("Account", {"account_type": "Warehouse",
|
||||||
"master_name": self.name}) and not frappe.db.get_value("Account",
|
"master_name": self.name}):
|
||||||
{"account_name": self.warehouse_name}):
|
|
||||||
if self.get("__islocal") or not frappe.db.get_value(
|
if self.get("__islocal") or not frappe.db.get_value(
|
||||||
"Stock Ledger Entry", {"warehouse": self.name}):
|
"Stock Ledger Entry", {"warehouse": self.name}):
|
||||||
self.validate_parent_account()
|
self.validate_parent_account()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user