Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
importmigration
1 Responder
7239 Vistas
Avatar
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
Avatar
Descartar
Avatar
Ray Carnes (ray)
Mejor respuesta

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/gZWcbyRtK0RErfICFntQtqq1YDxZYDMd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tC5ZbHWBJ1+KplgWeIpexoSOl8NqXTwsvV2GLpdaa12YrnQZv8/PmNDVpgf/TdTX1BYR8XOeU95qXbaldEON1u1HfW3Wqm7+rtpSurVN60ZArdsmtW4yFTYkQ2Ft8lpteZb2zUCWZey2lG73Vro53tBJcU92pUhbXbyPdMeTtqX0mAqth3poPQLFtCdae/CH1Q3eZdy2lB6vY/Deai2hvInaAmurhTfS8QbmCGwpPejKoPJYsASVh6gZdB45Z1B5QF9Kg1KMK6nK+NlSevhjisajMlNUHiyasRYM0551ewxrjsJDawusFvEsP+J3Fi+aH/H7+/sfvHHUffPHK6UAAAAASUVORK5CYII=</field>
</record>
</odoo>
This imports a Contact like this:

​

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Odoo 18: Cannot import DB dump from cloud installation into a fresh on-prem installation
import database migration
Avatar
Avatar
1
sept 25
863
Issue with import and comma in Excel File (odoo 19)
import
Avatar
0
sept 25
234
Importacion de Atributos y Valores
import
Avatar
Avatar
Avatar
2
may 25
2254
Import from Winbooks Resuelto
import
Avatar
Avatar
Avatar
Avatar
Avatar
4
may 25
6620
odoo module migration from version 14 to 16 Resuelto
migration
Avatar
Avatar
1
may 25
3001
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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