From 47a3c103344a5d6a558d8a5fa581c3440ca791e6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 21 Mar 2014 11:09:33 +0530 Subject: [PATCH] Patch to update old accounts property --- erpnext/patches/4_0/countrywise_coa.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/erpnext/patches/4_0/countrywise_coa.py b/erpnext/patches/4_0/countrywise_coa.py index 7bf4b26d8b..6ee898707b 100644 --- a/erpnext/patches/4_0/countrywise_coa.py +++ b/erpnext/patches/4_0/countrywise_coa.py @@ -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""") \ No newline at end of file