Patch: set root_type for old existing accounts
This commit is contained in:
parent
3dfe854108
commit
24e136e3f3
@ -28,6 +28,5 @@ execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_g
|
|||||||
erpnext.patches.4_0.remove_module_home_pages
|
erpnext.patches.4_0.remove_module_home_pages
|
||||||
erpnext.patches.4_0.split_email_settings
|
erpnext.patches.4_0.split_email_settings
|
||||||
erpnext.patches.4_0.fix_employee_user_id
|
erpnext.patches.4_0.fix_employee_user_id
|
||||||
erpnext.patches.4_0.set_account_details
|
|
||||||
erpnext.patches.4_0.import_country_codes
|
erpnext.patches.4_0.import_country_codes
|
||||||
execute:patches.4_0.countrywise_coa
|
execute:patches.4_0.countrywise_coa
|
||||||
|
|||||||
@ -5,5 +5,16 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc("setup", 'doctype', "company")
|
||||||
|
frappe.reload_doc("accounts", 'doctype', "account")
|
||||||
|
|
||||||
frappe.db.sql("""update tabAccount set account_type='Fixed Asset'
|
frappe.db.sql("""update tabAccount set account_type='Fixed Asset'
|
||||||
where account_type='Fixed Asset Account'""")
|
where account_type='Fixed Asset Account'""")
|
||||||
|
|
||||||
|
for d in (('Asset', 'Debit', 'No'), ('Liability', 'Credit', 'No'), ('Expense', 'Debit', 'Yes'),
|
||||||
|
('Income', 'Credit', 'Yes')):
|
||||||
|
frappe.db.sql("""update `tabAccount` set root_type = %s
|
||||||
|
where debit_or_credit=%s and is_pl_account=%s""", d)
|
||||||
|
|
||||||
|
frappe.db.sql("""update `tabAccount` set balance_must_be=debit_or_credit
|
||||||
|
where ifnull(allow_negative_balance, 0) = 0""")
|
||||||
Loading…
x
Reference in New Issue
Block a user