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

Odoo sh db migration error from odoo 16 to Odoo 18

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
migrationodooOdoo.shodoo16
1 Odpowiedz
548 Widoki
Awatar
user
Hi,

While am migrate my odoo 16 database from odoo 16 to Odoo 18 using the test upgrade button i get an error, how do i solve this?

class Attachment(models.Model):
_name = "travel_management.attachment"
_inherit = 'ir.attachment'

2025-11-24 06:56:07,023 23 CRITICAL db_3367148 odoo.service.server: Failed to initialize database `db_3367148`.
Traceback (most recent call last):
File "/home/odoo/src/odoo/17.0/odoo/service/server.py", line 1374, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-16>", line 2, in new
File "/home/odoo/src/odoo/17.0/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/17.0/odoo/modules/registry.py", line 110, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 541, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/tmp/tmpww539keu/migrations/base/0.0.0/pre-models-no-model-data-delete.py", line 108, in _process_end
return super(IrModelData, self)._process_end(modules)
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2593, in _process_end
self._process_end_unlink_record(record)
File "/home/odoo/src/odoo/17.0/addons/website/models/ir_model_data.py", line 36, in _process_end_unlink_record
return super()._process_end_unlink_record(record)
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2522, in _process_end_unlink_record
record.unlink()
File "/home/odoo/src/odoo/17.0/addons/mail/models/ir_model_fields.py", line 59, in unlink
return super().unlink()
File "/tmp/tmpww539keu/migrations/base/0.0.0/pre-models-ir_model.py", line 210, in unlink
raise util.MigrationError(message)
odoo.upgrade.util.exceptions.UpgradeError: 💥 It looks like you forgot to call `util.remove_field` on the following fields: travel_management.attachment.theme_template_id
0
Awatar
Odrzuć
user
Autor

Hi,
Kunjan Patel. Thanks you for your answer, is this i need to write this in my Odoo 18 modules? not in the 16? since am getting this error before commiting the migrated modules. Can i write this same in the version 16 of that module?

Kunjan Patel

Hello,
The odoo.upgrade.util module is only available in Odoo Enterprise upgrade scripts managed by Odoo SA. It won't work in your custom module migrations.

For custom module migrations, use this approach instead:
# migrations/18.0.1.0.0/pre-migrate.py
def migrate(cr, version):
# Remove orphaned field if needed
cr.execute("""
DELETE FROM ir_model_fields
WHERE model = 'ir.attachment'
AND name = 'theme_template_id'
AND module = 'travel_management'
""")
Hope it helps

Kunjan Patel

Hello
Odoo.sh migration workflow:
1. Fix imports in your v18 branch first (before migration)
2. Push the v18-compatible code to v18 branch
3. Then trigger the migration on Odoo.sh

Odoo.sh runs migration using your v18 branch code, so imports must be v18-compatible before you start the upgrade - not after.

Awatar
Kunjan Patel
Najlepsza odpowiedź
Hello user,
I hope you are doing well

Wrong model inheritance creates orphan fields during migration.

class Attachment(models.Model):
      _inherit = 'ir.attachment'  # Remove _name line

or add migration script (migrations/18.0.1.0.0/pre-migrate.py):
from odoo.upgrade import util
def migrate(cr, version):
      util.remove_field(cr, 'travel_management.attachment', 'theme_template_id')

I hope this information helps you

Thanks & Regards,
Kunjan Patel
0
Awatar
Odrzuć
user
Autor

Hi,
Kunjan Patel. Thanks you for your answer, is this i need to write this in my Odoo 18 modules? not in the 16? since am getting this error before commiting the migrated modules. Can i write this same in the version 16 of that module?

user
Autor

What i need to know is that in which version of module i need to write this? since currently mu sh have the odoo 16 modules, and after migrating and the migration reached on the commit stage then only i will update the odoo 18 modules. But before that i need to fix this

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ść
How to hide a field in a view for companies Rozwiązane
odoo Odoo.sh
Awatar
Awatar
2
paź 24
2562
Can i export odoo 8 quotation and import it in odoo14
migration odoo
Awatar
Awatar
Awatar
Awatar
3
paź 23
3124
Problems Migrating (OpenUpgrade) Odoo Sites from v15 -> v16
migration openupgrade odoo16
Awatar
Awatar
2
gru 25
2935
migration from odoo16 to 17
migration odoo17 odoo16
Awatar
Awatar
1
lis 25
2048
How to migrate Website to another Odoo instance? Rozwiązane
migration website odoo
Awatar
Awatar
Awatar
2
lip 25
5719
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