3

In V11 enterprise, For some models there's an archive function, but not for company. If I have multiple companies but then I have a company that is out of business, how can I disabled or archived this company so that it does not appear in all modules and even admin can't assign it to any user? It seems that once a company is created even if I don't have any transactions yet, I cannot delete it because I get an error of referential integrity in the database and the archive function is not available for companies.

I tried to delete company record but I got the following error message.

The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records 
still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: Account - account.account]
Younis Mahsud
  • 437
  • 5
  • 15
  • Just add active field to `res.company` and set it to False to archive them this how archive works in Odoo – Charif DZ Jul 08 '19 at 21:17

2 Answers2

5

If you create a company, Odoo will create its warehouse,locations for that company. If you made any transactions using that company account move and stock move will be created according to the move. So when you're trying to delete the company it will effect all the records in your database in your case error causing in accounts section. so there still some records related to your company in accounts. So you remove all user access to that company, so no one can access that company and won't be able to use that company.

Thayif kabir
  • 715
  • 5
  • 20
2

When you create a company, a dozen other things are also created like routes, warehouses etc. So all these records are now dependant on this company. That's why you are not able to delete the company. You can remove the access for that company for every user so that they don't see anything related to that company.

Mihran Thalhath
  • 325
  • 2
  • 10