This question has been flagged

Hello, I'm trying to start a new fresh chart of accounts

when I try to delete the following accounts I get this error

 You cannot remove/deactivate an account which is set on a customer or vendor.


Here's the list of accounts:

  • 101200 Account Receivable

  • 101300 Tax Paid 

  • 111100 Account Payable

  • 111200 Tax Received

  • 200000 Product Sales

  • 220000 Expenses


when I checked the log file I got this 

odoo.sql_db: bad query: UPDATE "account_account" SET "code"='220000',"write_uid"=1,"write_date"=(now() at time zone 'UTC') WHERE id IN (68)


any help will be appreciated. Thanks


Avatar
Discard
Best Answer

You have to delete/change the related objects (customers, products etc.) first.

Avatar
Discard
Author

I installed only accounting module.. however when I checked the customers which are listed under Accounting module, it didn't allow me to delete the accounts parameters listed under my company. Anyways I had to erase these data from postgresql manually.

It is not recommended to do that in the database directly. Even if you only install the accounting module, you should check the usual suspects for relationships and apply appropriate filters in order to find and change/delete corresponding entries.

"Usual suspects" are for example:

- partner, contacts, employees, users, products, fiscal positions, taxes etc.