<commit_before># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

def execute():
	account_table_columns = frappe.db.get_table_columns("Account")
	if "debit_or_credit" in account_table_columns and "is_pl_account" in account_table_columns:
		frappe.db.sql("""UPDATE tabAccount SET root_type = CASE
			WHEN (debit_or_credit='Debit' and is_pl_account = 'No') THEN 'Asset'
			WHEN (debit_or_credit='Credit' and is_pl_account = 'No') THEN 'Liability'
			WHEN (debit_or_credit='Debit' and is_pl_account = 'Yes') THEN 'Expense'
			WHEN (debit_or_credit='Credit' and is_pl_account = 'Yes') THEN 'Income'
			END""")
<commit_msg>reload account doc in root type patch<commit_after># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

def execute():
	frappe.reoad_doc("accounts", "doctype", "account")

	account_table_columns = frappe.db.get_table_columns("Account")
	if "debit_or_credit" in account_table_columns and "is_pl_account" in account_table_columns:
		frappe.db.sql("""UPDATE tabAccount SET root_type = CASE
			WHEN (debit_or_credit='Debit' and is_pl_account = 'No') THEN 'Asset'
			WHEN (debit_or_credit='Credit' and is_pl_account = 'No') THEN 'Liability'
			WHEN (debit_or_credit='Debit' and is_pl_account = 'Yes') THEN 'Expense'
			WHEN (debit_or_credit='Credit' and is_pl_account = 'Yes') THEN 'Income'
			END""")

{'fraction_non_alphanumeric': 0.10675931775110549, 'fraction_numerical': 0.006317119393556538, 'mean_word_length': 5.977973568281938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4256822', 'n_tokens_mistral': 603, 'n_tokens_neox': 545, 'n_words': 151}