Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Odoo sh db migration error from odoo 16 to Odoo 18

Naroči se

Get notified when there's activity on this post

This question has been flagged
migrationodooOdoo.shodoo16
1 Odgovori
573 Prikazi
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
Opusti
user
Avtor

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
Opusti
user
Avtor

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
Avtor

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!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to hide a field in a view for companies Solved
odoo Odoo.sh
Avatar
Avatar
2
okt. 24
2566
Can i export odoo 8 quotation and import it in odoo14
migration odoo
Avatar
Avatar
Avatar
Avatar
3
okt. 23
3127
Problems Migrating (OpenUpgrade) Odoo Sites from v15 -> v16
migration openupgrade odoo16
Avatar
Avatar
2
dec. 25
2955
migration from odoo16 to 17
migration odoo17 odoo16
Avatar
Avatar
1
nov. 25
2050
How to migrate Website to another Odoo instance? Solved
migration website odoo
Avatar
Avatar
Avatar
2
jul. 25
5729
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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