Patch to update old accounts property

This commit is contained in:
Nabin Hait 2014-03-21 11:09:33 +05:30
parent e67202484d
commit 47a3c10334

View File

@ -10,11 +10,9 @@ def execute():
frappe.db.sql("""update tabAccount set account_type='Fixed Asset'
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 report_type =
if(is_pl_account=='Yes', 'Profit and Loss', 'Balance Sheet')""")
frappe.db.sql("""update `tabAccount` set balance_must_be=debit_or_credit
where ifnull(allow_negative_balance, 0) = 0""")