mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 03:29:16 +00:00
Merge branch 'master' of https://github.com/webnotes/erpnext
This commit is contained in:
@@ -432,6 +432,7 @@ class DocType(BuyingController):
|
||||
d.account_head = other['account_head']
|
||||
d.rate = flt(other['rate'])
|
||||
d.tax_amount = flt(other['tax_amount'])
|
||||
d.cost_center = other["cost_center"]
|
||||
d.idx = idx
|
||||
idx += 1
|
||||
return obj.doclist
|
||||
|
||||
@@ -24,7 +24,6 @@ from webnotes.model.doc import make_autoname
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
from accounts.utils import add_ac
|
||||
from utilities.transaction_base import TransactionBase
|
||||
|
||||
class DocType(TransactionBase):
|
||||
@@ -71,14 +70,16 @@ class DocType(TransactionBase):
|
||||
return g
|
||||
|
||||
def add_account(self, ac, par, abbr):
|
||||
ac = add_ac({
|
||||
ac_bean = webnotes.bean({
|
||||
"doctype": "Account",
|
||||
'account_name':ac,
|
||||
'parent_account':par,
|
||||
'group_or_ledger':'Group',
|
||||
'company':self.doc.company,
|
||||
'account_type':'',
|
||||
'tax_rate':'0'
|
||||
"freeze_account": "No",
|
||||
})
|
||||
ac_bean.ignore_permissions = True
|
||||
ac_bean.insert()
|
||||
|
||||
msgprint(_("Created Group ") + ac)
|
||||
|
||||
@@ -109,8 +110,8 @@ class DocType(TransactionBase):
|
||||
parent_account = self.get_parent_account(abbr)
|
||||
|
||||
if not sql("select name from tabAccount where name=%s", (self.doc.name + " - " + abbr)):
|
||||
|
||||
ac = add_ac({
|
||||
ac_bean = webnotes.bean({
|
||||
"doctype": "Account",
|
||||
'account_name': self.doc.name,
|
||||
'parent_account': parent_account,
|
||||
'group_or_ledger':'Ledger',
|
||||
@@ -119,8 +120,12 @@ class DocType(TransactionBase):
|
||||
'tax_rate': '0',
|
||||
'master_type': 'Supplier',
|
||||
'master_name': self.doc.name,
|
||||
"freeze_account": "No"
|
||||
})
|
||||
msgprint(_("Created Account Head: ") + ac)
|
||||
ac_bean.ignore_permissions = True
|
||||
ac_bean.insert()
|
||||
|
||||
msgprint(_("Created Account Head: ") + ac_bean.doc.name)
|
||||
else:
|
||||
self.check_parent_account(parent_account, abbr)
|
||||
else :
|
||||
|
||||
Reference in New Issue
Block a user