Parent account mandatory for all non-root accounts

This commit is contained in:
Nabin Hait
2014-06-03 18:33:20 +05:30
parent 9198444a3b
commit bc7efa6da6
3 changed files with 5 additions and 3 deletions

View File

@@ -91,6 +91,8 @@ class Company(Document):
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]])
if not account.parent_account:
account.ignore_mandatory = True
account.insert()
def set_default_accounts(self):