This commit is contained in:
Akhilesh Darjee
2013-06-17 19:27:30 +05:30
15 changed files with 129 additions and 86 deletions

View File

@@ -115,18 +115,20 @@ class DocType(TransactionBase):
if not webnotes.conn.exists("Account", (self.doc.name + " - " + abbr)):
parent_account = self.get_receivables_group()
# create
from accounts.utils import add_ac
ac = add_ac({
'account_name':self.doc.name,
ac_bean = webnotes.bean({
"doctype": "Account",
'account_name': self.doc.name,
'parent_account': parent_account,
'group_or_ledger':'Ledger',
'company':self.doc.company,
'account_type':'',
'tax_rate':'0',
'master_type':'Customer',
'master_name':self.doc.name
'master_name':self.doc.name,
"freeze_account": "No"
})
msgprint("Account Head: %s created" % ac)
ac_bean.ignore_permissions = True
ac_bean.insert()
msgprint("Account Head: %s created" % ac_bean.doc.name)
else :
msgprint("Please Select Company under which you want to create account head")

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-01-23 19:57:18",
"creation": "2013-06-11 14:26:44",
"docstatus": 0,
"modified": "2013-01-29 16:28:03",
"modified": "2013-06-11 14:27:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -270,7 +270,7 @@
"label": "Credit Days",
"oldfieldname": "credit_days",
"oldfieldtype": "Int",
"permlevel": 2
"permlevel": 1
},
{
"doctype": "DocField",
@@ -280,7 +280,7 @@
"oldfieldname": "credit_limit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 2
"permlevel": 1
},
{
"doctype": "DocField",
@@ -339,7 +339,7 @@
},
{
"doctype": "DocPerm",
"permlevel": 2,
"permlevel": 1,
"role": "Sales User"
},
{
@@ -355,7 +355,7 @@
},
{
"doctype": "DocPerm",
"permlevel": 2,
"permlevel": 1,
"role": "Sales Master Manager",
"write": 1
}