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
    • e-learning
    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
    • Conocimientos
    • 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
    Explorar todos los sectores
  • 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
    • Servicios para 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

Unique external and internal product values in Odoo 10

Suscribirse

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

Se marcó esta pregunta
11 Respuestas
8151 Vistas
Avatar
J C

Hi Odoo community, I have quite a specific question regarding the unique values Odoo assigns to products created (for example __export__.product_template_ and internal IDs)

We always start with our main Excel file where we keep all our data updated. From there we import products, their characteristics, prices, and later quantities in Odoo. When importing, Odoo assigns a unique ID to every single product. That means if we import 1000 articles Odoo will generate 1000 unique IDs. 

What I wonder is how these IDs are used through Odoo and the sale process. We mostly use POS for sales so what if an item from within our 1000 products list is sold and processed through the invoice system (for example Products => POS => Payment => Invoice), how will the unique ID influence all this?

The reason I ask because we are at the beginning of setting up our system so this 1000 product list will change to regularly add more articles from Excel. So our next import might be 1500 but then it's possible the unique ID from the item that was sold through the POS before will be overwritten with another item taking over that unique ID (because items were not added at the bottom of our product list but they were sorted alphabetically so lines are added in between).

Conclusion, should we be careful with the internal IDs created in Odoo or can they just be overwritten with other products regardless if they are already sold or not?? What's the influence further down the line?...

Hopefully I could explain myself properly, if not please ask me for more info...


Thanks in advance

0
Avatar
Descartar
Avatar
La Jayuhni Yarsyah
Mejor respuesta

You say that "Odoo assigns a unique ID to every single product",, its definitely wrong
Beacause when importing data,, odoo will not creating external id ,, but it's created right before you exporting the record.

https://www.odoo.com/forum/help-1/question/what-is-an-external-id-and-what-is-its-uses-95070

if i'm right,, you import data from excel file without "id" columns ,, right ??

if you not defined "id" values in csv/excel file wich you import,, then odoo would not register external id record

But why when you exporting the data odoo will show "id" column with values wich formated __export__.product_template_{number} ?it because when you export the record, odoo will check is record already has external_id ? if it not,, odoo will create external id for the record first,,

External id stored in ir.model.data,, on the backend ui,  you can access it by activating developer mode,, then go to "Settings"->technical->Sequence&Identifiers->External Identifier"

For explanation maybe you can try this step:

  1. Import an example data (without "id" column) for product.template, for example try this

    one (product.template.csv) :

    name,default_code,sale_ok,purchase_ok,list_price
    TEST PRODUCT,TEST001,1,1,25000
  2. Get your new database id data and search it on "external identifier" menu ( ir.model.data),,  find by model and record id,, see are its created after importing #1 ?

  3. Try export the data that you import,, the file will contains external id (generated by odoo)

  4. Search it on External Identifier menu,,  it should new external id generated because you imported non defined external id records

But if you try to import data with defining "id" column,, it will generate ir.model.data record when importing the record from external sources (csv/excel)

Ex (defining id in file to import):

id,name,default_code,sale_ok,purchase_ok,list_price
product_template_test001,TEST PRODUCT 1,TEST001,1,1,26000



Should be carefull ?yes,, worry will overwrite data,, but if you has a good plan for structure it very usefull

For using external sources data,, i suggest you to define the external id on spreadsheet input file to be write in odoo, because your your record stored on odoo depends by your spreadsheet/excel input,, so you need to have a same identifier between both of dabatabses (spreadsheet and pgsql/odoo) 


 

Regards..

1
Avatar
Descartar
J C
Autor

Great info, thanks for your reply! I understand the uses of external ids better now. If the records exist they will be updated and if they don't it will be inserted and automatically assigned an ID. That's good because in any case, the new info will be there. However we use Odoo always from importing Excel to Odoo so exporting these IDs is not needed in our case (one way).

I think the only question remaining is whether updating the product info from an Excel has influence through the POS or finance system. I don't understand how Odoo processes that in relation to the products list. I'll try to explain again with my example of the fruit before.

If I make a sale in the POS/Sales of my cherries which has ID 2. If I then update my list (import newest version) and now blueberry has ID 2 will the POS/Sale orders get messed up with that new data?

And what about if I disregard the ID and import without, will the sale process be influenced?

La Jayuhni Yarsyah

What is you mean with "ID" ??database id or external id ??

if you mean is database id,, is id on pgsql or the spreadsheet ?? i

Maybe you can show more detail data/structure that you implement,,,

If the record in odoo has "external_id", then you try to update it with importing by spreadsheet/csv file wich in those file you define an external id (id) value, it will overwrite the record (in your question that cherry will update to blueberry)

will messed up ?i think it depends on your purpose and your sale report to be expected..

if you disregard the id it will create new record.

and 1more, dont forget to checklist my answer (:-D)

Thanks and Regards

La Jayuhni Yarsyah

J C
Autor

I mean database ID. The ID Odoo creates to have a unique value for every product. Let's focus on what I mean with the sale process.

I'll explain our situation better. We have a system selling spare parts and we are importing all items into Odoo part by part as we count them. So today it is a list of 500 items, next week maybe 1000 items. The list always grows. We keep everything correct in Excel first before importing into Odoo. Soon we want to start importing our first part into Odoo for a small scale test. So we are importing about 200 items with the correct name, quantity, price and barcode. Printing the barcodes and sticking them onto the items allows us to use the POS system in Odoo for registering orders. So the item gets scanned first and then registered in the POS before it is sold.

This means once a sale is done there is a POS order linked to that article, right. Hence my question how all these orders are linked to the products?

If a certain product is linked to a sale and later by importing a new list this certain item gets a new internal ID (overwritten) will we still be able to see the initial item linked to the POS order?

La Jayuhni Yarsyah

Yes it should still linked to overwritted product..

So for example:

Product (import spreadsheet):

ID = product_1, Name="Monitor", Barcode="P.001", SalePrice=200

Then the imported product will got database id=1

Then when you do transaction with odoo POS module (Sale Order Line example data):

Customer ID=100,Product ID=1,UnitPrice=200,Qty=2,Total=400

And Then, a few weeks latter you update / change product description with importing spreadsheet file , ex:

ID = product_1, Name="LED Monitor", Barcode="P.001A", SalePrice=200

When after updating the product, the current related product from sale_order_line table will still related to product_id=1,, but when you open in odoo interface, in product fields will show the current product description,,

Hope it done your questions

Regards

La Jayuhni Yarsyah

Avatar
Xavier Brochard
Mejor respuesta

Internal ID are numbers set automaticaly by Postgresql (the database engine), they will not be reused : Postgresql will allways increase the number.

As Erwin said, don't touch database (internal) IDs. But don't worry, you can't modify them without good Postgresql knowledge. I've forced internal IDs for specific needs, and after it was (hardly) done I've found a better, simpler and quicker solution.
0
Avatar
Descartar
Avatar
Ermin Trevisan
Mejor respuesta

Never touch database (internal) IDs. Only use external IDs. You can export your products to see what happens to the IDs. Both IDs are IDs, they identify objects and are not influenced by processes.

0
Avatar
Descartar
J C
Autor

Hi Ermin, thanks for your quick answer and clarification. Do you see where my worry is? What if something is sold having a specific internal ID and then after I import a new list with more products added and the IDs change? Will Odoo have troubles mapping IDs to the new items when values are overwritten and are you sure it does not influence the sale orders and accounting stuff already created on the first ID value?

Ermin Trevisan

If you buy and sell apples, you define a product "Apple". This product has a database ID and an external ID. The IDs remain the same regardless if you buy or sell apples. You do not have an ID for single individual apples. If you import data with an external ID and this ID already exists, the existing data gets updated, if it does not exist, a new object (product) will be created.

Ermin Trevisan

If you buy and sell apples, you define a product "Apple". This product has a database ID and an external ID. The IDs remain the same regardless if you buy or sell apples. You do not have an ID for single individual apples. If you import data with an external ID and this ID already exists, the existing data gets updated, if it does not exist, a new object (product) will be created.

Ermin Trevisan

If you want to use identifications for each singular apple individually, you have to use serial numbers.

J C
Autor

I'll take your example: if I have import a list of 3 articles; apples, cherries and oranges (alphabetically sorted) respectively having internal ID 1, 2 and 3 (automatically given by Odoo). If I import a new list later that adds item blueberry in between apples and cherries will the IDs shift like 1-apples 2-blueberry 3-cherries 4-oranges or will it keep the order of before and give blueberry number 4?

Are the internal IDs coupled to the the other fields or how does Odoo process this exactly?

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

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

Inscribirse
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