Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

What is the Best Way to Migrate Data in a Custom Module?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
importmigration
1 Răspunde
7240 Vizualizări
Imagine profil
Tyler K

I am doing a migration for a custom module that involves a significant schema change (e.g., merging tables together). I exported the data from the old version module of the module, processed it to match the new schema, and am now trying to figure out how to import it. I am curious if there is a suggested best way to solving this kind of problem. Based off of my current understanding, I have the following options.

  • Import via csv.

    • I actually tried this, but ran into an issue with not being able to import readonly fields. I can get past this by making these fields editable but I like to use the readonly attribute for fields that should only be set programmatically. I suppose I could just make the fields readonly in the view and not on the model, but I would prefer to set this on the model if possible.

  • Import via module data.

    • I assume importing data this way would bypass the readonly field restriction, but I am unsure how it would handle conversions. I have a binary field that when exported as csv is Base64 encoded and am not sure if it would properly decode that data when reading it from an xml file.

  • Import via Odoo migration script.

    • Seems like this option would require installing the old version alongside the new version and mapping data from the old models to the new models, which seems a bit clumsy.

  • Import via sql script.

    • This would certainly bypass all restrictions placed by the framework, but seems a little dangerous. If my assumption is correct, when importing data via any of the above methods the ORM is used to create your database records, which means all validation and/or computed properties will be properly processed. Thus it seems like importing data should probably go through the ORM.

0
Imagine profil
Abandonează
Imagine profil
Ray Carnes (ray)
Cel mai bun răspuns

I would use module data.

You can copy the CSV  Base64 encoded string from the image field and use it directly in an XML file, like this:

<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record model="res.partner" id="1">
<field name="name">Odoo</field>
<field name="image_1920">iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAAIdae4dcfYhae4lbfIldf4pefYpggIxhgo1igI9lhI9nhJBnhZJph5Vui5dwjJhwjZlxj5t1kZp2kJt3kZx1kp13k6F+maOAmaOCm6SCm6SCnKeIn6mHn62Npa2PpK6Ppa+Rp7KWq7OWrLWarbearrecr7qhs72jt76kt7+nub+ousCou8Cqu8GqvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHtU8wYAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAFMElEQVR4Xs2c6ULqMBCFe0HcUNwBtSooiPv7v503bU+lLZnMpE3b+X4VnJwcS5s9iX6bs1o+zKeT8Wg0nkznD8sVvm5CI1ubeDL8Z2U4iTcIqkVtW+tzOHBwvkawN7VsvV0hXwFXb0jkRQ1bU2QoZoqEHvjaigfIy4tBjORS/GydIJsanEBChoetn2PkUJPjHwgJENt6P4J6A47eIcYitXUA5YYcQI5DZusCqgG4gKQbia0lFAOxhKwLga1DyAXjEMIOWFv30ArKPcRJOFsNSioXXCnmtvVFNBCaM/xCFnactm6h0Qq3yMSKy9YpBFriFNnYcNgK/gZWcbyRtK0RErfICFntQtqq1YDxZYDMdiBsfSNd63wjwwp2W525onzZbSFJJyDLMlZbnTxXOdbny2arg3ewiO19tNhqvby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pgf/TdTX1BYR8XOeU95qXbaldEON1u1HfW3Wqm7+rtpSurVN60ZArdsmtW4yFTYkQ2Ft8lpteZb2zUCWZey2lG73Vro53tBJcU92pUhbXbyPdMeTtqX0mAqth3poPQLFtCdae/CH1Q3eZdy2lB6vY/Deai2hvInaAmurhTfS8QbmCGwpPejKoPJYsASVh6gZdB45Z1B5QF9Kg1KMK6nK+NlSevhjisajMlNUHiyasRYM0551ewxrjsJDawusFvEsP+J3Fi+aH/H7+/sfvHHUffPHK6UAAAAASUVORK5CYII=</field>
</record>
</odoo>
This imports a Contact like this:

​

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Odoo 18: Cannot import DB dump from cloud installation into a fresh on-prem installation
import database migration
Imagine profil
Imagine profil
1
sept. 25
863
Issue with import and comma in Excel File (odoo 19)
import
Imagine profil
0
sept. 25
234
Importacion de Atributos y Valores
import
Imagine profil
Imagine profil
Imagine profil
2
mai 25
2254
Import from Winbooks Rezolvat
import
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
mai 25
6620
odoo module migration from version 14 to 16 Rezolvat
migration
Imagine profil
Imagine profil
1
mai 25
3001
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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