[chart of accounts/cost center] [add account/cost center] fix in permission issue

This commit is contained in:
Anand Doshi
2013-06-11 17:33:37 +05:30
parent 433047b2e2
commit 2e0cc41fc6
4 changed files with 25 additions and 18 deletions

View File

@@ -222,7 +222,6 @@ class DocType:
# Create default cost center
# ---------------------------------------------------
def create_default_cost_center(self):
from accounts.utils import add_cc
cc_list = [
{
'cost_center_name':'Root',
@@ -244,7 +243,10 @@ class DocType:
}
]
for cc in cc_list:
add_cc(cc)
cc.update({"doctype": "Cost Center"})
cc_bean = webnotes.bean(cc)
cc_bean.ignore_permissions = True
cc_bean.insert()
webnotes.conn.set_value("Company", self.doc.name, "cost_center",
"Default CC Ledger - " + self.doc.abbr)