Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

How can I delete or archive a company?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
companies
4 Odpowiedzi
32392 Widoki
Awatar
Ivan Coro

In V10 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 disable or archive this company so that it does not appear in all modules? 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. Please help.

0
Awatar
Odrzuć
Awatar
Ray Carnes
Najlepsza odpowiedź

Did you try removing access to that Company for all users?

4
Awatar
Odrzuć
Awatar
Steven Segers
Najlepsza odpowiedź

I know it's an old post, but as deleting a company is not addressed anywhere and this was the first hit when I googled it, I figured I could add a suggestion here on how to delete a company.


As Dheeraj pointed out, to delete a record you must first delete all records in other tables that relate to it. As almost everything in Odoo relates to a company, it is probably going to be quite a tedious and time consuming job to do that through the UI. So, an easier approach to do this is through the database. 


1. Check which Id the company has by querying the companies table:


select * from res_company rc;


2. Execute the following update


update res_company rc set resource_calendar_id = null where id = 123; -- Replace 123 with the id of your company


3. Execute the following select to generate a bunch of delete statements to delete all data related to the company:


SELECT 'delete from ' || columns.table_name || ' where ' || columns.column_name || '= 123;' -- Replace 123 with the id of your company
FROM information_schema.columns
join information_schema.tables t on columns.table_catalog = t.table_catalog and columns.table_schema = t.table_schema and columns.table_name = t.table_name
where (column_name = 'res_company_id' or column_name = 'company_id' or (t.table_name = 'res_company' and column_name = 'id')) and t.table_type = 'BASE TABLE';

4. Now execute the delete statements.


Depending on your exact situation, you may get some constraint violations when executing the delete statements. You'll have to resolve those in the appropriate way:

  • Reorder the statements to first delete items referencing another table

  • Set foreign key fields to null in case of circular dependencies (step 2 is an example)

I also found that some tables do not reference res_company directly. For example, account_payment does not reference res_company. So you have to derive the company from a related table. For example:

delete from account_payment ap where journal_id in (select id from account_journal aj where company_id = 123);


In my database I also found records of company A referencing records of company B, but let's not dwell on that :)


It goes without saying that the above advice comes without any guarantee whatsoever and a big warning: BE CAREFULL

  • Make sure you have a backup before you start

  • Try on a test-database first

  • Only do this when you understand what you are doing. Don't just execute these statements blindly.

If you end up with an empty production-database: too bad for you :)


(For some reason this text editor keeps screwing-up my text. I really struggled to get the queries above in, so it's possible some space or character ended up dropping off)

6
Awatar
Odrzuć
Awatar
Dheeraj Balodia
Najlepsza odpowiedź

As per my knowledge,  you have to remove that company details from everywhere than only you can be able to delete the company. Let's say if a company is used in some accounting than you have to delete the accounting first and then delete the company

0
Awatar
Odrzuć
Awatar
Mahmoud Abdelwahid
Najlepsza odpowiedź

You can inherit 'res.company' model and add Boolean 'active' field , then in this company make active = False

0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Como elimino una compañia(empresa) adicional que se creo y no tiene ningun movimiento Rozwiązane
companies
Awatar
Awatar
Awatar
2
kwi 22
179
Error entering companies Rozwiązane
companies
Awatar
Awatar
1
sie 19
3235
Concept (without multi-companies) of creating other companies Rozwiązane
companies
Awatar
Awatar
Awatar
Awatar
3
lip 25
3813
comparision between open erp and i cloud erps
companies
Awatar
0
mar 15
4483
Selecting multiple companies instead of one in v7?
companies
Awatar
0
mar 15
5116
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now