diff --git a/erpnext/patches/4_0/countrywise_coa.py b/erpnext/patches/4_0/countrywise_coa.py index 242585652f..d121232546 100644 --- a/erpnext/patches/4_0/countrywise_coa.py +++ b/erpnext/patches/4_0/countrywise_coa.py @@ -12,12 +12,15 @@ def execute(): where account_type='Bank or Cash' and account_name in ('Cash', 'Cash In Hand')""") ac_types = {"Fixed Asset Account": "Fixed Asset", "Bank or Cash": "Bank"} - for old, new in ac_types.items: + for old, new in ac_types.items(): frappe.db.sql("""update tabAccount set account_type=%s where account_type=%s""", (new, old)) - frappe.db.sql("""update `tabAccount` set report_type = - if(is_pl_account=='Yes', 'Profit and Loss', 'Balance Sheet')""") + try: + 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 + frappe.db.sql("""update `tabAccount` set balance_must_be=debit_or_credit + where ifnull(allow_negative_balance, 0) = 0""") + except: + pass \ No newline at end of file