mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
[cleanup] #402 changed fieldname company_name to company in Cost Center
This commit is contained in:
6
patches/july_2013/p03_cost_center_company.py
Normal file
6
patches/july_2013/p03_cost_center_company.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("accounts", "doctype", "cost_center")
|
||||
webnotes.conn.sql("""update `tabCost Center` set company=company_name""")
|
||||
webnotes.conn.sql_ddl("""alter table `tabCost Center` drop column company_name""")
|
||||
@@ -79,9 +79,9 @@ def add_accounts(accounts_to_add, check_fn=None):
|
||||
def add_aii_cost_center():
|
||||
for company, abbr in webnotes.conn.sql("""select name, abbr from `tabCompany`"""):
|
||||
if not webnotes.conn.sql("""select name from `tabCost Center` where cost_center_name =
|
||||
'Auto Inventory Accounting' and company_name = %s""", company):
|
||||
'Auto Inventory Accounting' and company = %s""", company):
|
||||
parent_cost_center = webnotes.conn.get_value("Cost Center",
|
||||
{"parent_cost_center['']": '', "company_name": company})
|
||||
{"parent_cost_center['']": '', "company": company})
|
||||
|
||||
if not parent_cost_center:
|
||||
webnotes.errprint("Company " + company + "does not have a root cost center")
|
||||
@@ -92,7 +92,7 @@ def add_aii_cost_center():
|
||||
"cost_center_name": "Auto Inventory Accounting",
|
||||
"parent_cost_center": parent_cost_center,
|
||||
"group_or_ledger": "Ledger",
|
||||
"company_name": company
|
||||
"company": company
|
||||
})
|
||||
cc.insert()
|
||||
|
||||
|
||||
@@ -249,4 +249,5 @@ patch_list = [
|
||||
"execute:webnotes.delete_doc('Report', 'Delivered Items To Be Billed')",
|
||||
"execute:webnotes.delete_doc('Report', 'Received Items To Be Billed')",
|
||||
"patches.july_2013.p02_copy_shipping_address",
|
||||
"patches.july_2013.p03_cost_center_company",
|
||||
]
|
||||
Reference in New Issue
Block a user