Skip to Content
Menu
This question has been flagged
1 Reply
5970 Views

After installing the US Chart of Accounts, I now have duplicate Account Types for things like Cash, Expense, Receivable, etc.

I uninstalled the module, but these entries still remain.  I can't delete them because they are linked to accounts in my chart.  

I have no transactions, so I'd like to clean this up before making sales and purchases.

Avatar
Discard
Author Best Answer

1. Reinstall the US Chart of Accounts.

2. Run these SQL statements to reassign any accounts back to the defaults from the Configurable Chart and delete the types from the US Chart:

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_cash') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_cash'); 

DELETE from account_fiscal_position_template a using ir_model_data i where a.id = i.res_id and i.model = 'account.fiscal.position.template' and i.module = 'l10n_us';

DELETE from account_tax_template a using ir_model_data i where a.id = i.res_id and i.model = 'account.tax.template' and i.module = 'l10n_us';

DELETE from account_chart_template a using ir_model_data i where a.id = i.res_id and i.model = 'account.chart.template' and i.module = 'l10n_us';

DELETE from account_account_template a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.template' and i.module = 'l10n_us';

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_cash';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='conf_account_type_equity') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_equity');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_equity';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_expense') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_expense');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_expense';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_income') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_income');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_income';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_income') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_income');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_income';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_liability') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_liability');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_liability';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_payable') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_account_payable');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_account_payable';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_receivable') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_account_receivable');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_account_receivable';

UPDATE account_account set user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'account' and i.name='data_account_type_bank') where user_type = (select a.id from account_account_type a,ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_credit_card');

DELETE from account_account_type a using ir_model_data i where a.id = i.res_id and i.model = 'account.account.type' and i.module = 'l10n_us' and i.name='user_type_credit_card';


3. Uninstall the US Chart of Accounts.

Avatar
Discard
Related Posts Replies Views Activity
4
Mar 24
29184
1
Dec 22
13646
2
Dec 22
5245
4
Aug 24
25326
1
Apr 16
4070