Odoo Help

0

Delete / reset US Chart of Account changes, remove duplicate account types

By
Ray Carnes
on 7/18/15, 11:28 AM 1,878 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.

0
Ray Carnes
On 7/18/15, 11:32 AM

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.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/18/15, 11:28 AM
Seen: 1878 times
Last updated: 7/18/15, 11:32 AM