Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Odoo sh db migration error from odoo 16 to Odoo 18

Odoberať

Get notified when there's activity on this post

This question has been flagged
migrationodooOdoo.shodoo16
1 Odpoveď
553 Zobrazenia
Avatar
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
Avatar
Zrušiť
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.

Avatar
Kunjan Patel
Best Answer
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
Avatar
Zrušiť
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

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
How to hide a field in a view for companies Solved
odoo Odoo.sh
Avatar
Avatar
2
okt 24
2564
Can i export odoo 8 quotation and import it in odoo14
migration odoo
Avatar
Avatar
Avatar
Avatar
3
okt 23
3126
Problems Migrating (OpenUpgrade) Odoo Sites from v15 -> v16
migration openupgrade odoo16
Avatar
Avatar
2
dec 25
2940
migration from odoo16 to 17
migration odoo17 odoo16
Avatar
Avatar
1
nov 25
2048
How to migrate Website to another Odoo instance? Solved
migration website odoo
Avatar
Avatar
Avatar
2
júl 25
5719
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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