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

Cannot search archived products by barcode

Suscribirse

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

Se marcó esta pregunta
9 Respuestas
11079 Vistas
Avatar
Glen Lowe

Odoo CE 10

It seems that when you archive a product the barcode and the cost temporarily disappear from the product for some reason (even though they are still stored in database and show up when re-activated).  This makes it impossible to search archived items by barcode.  So lets say you want to add a new item and you get the "Cannot add item: this barcode already exists" message.  This means you cannot search the archived items for the matching  barcode and simply re-activate it.  I currently have to:

1) Search archived products by name or other filter

2) Temporarily un-archive product to "see" the barcode and check if it's my match

3 If it's not a match, repeat this process with all the filtered archived items until I find my barcode match and un-archive it

Is this the normal behavior?  How can I make this easier?  Thank you!

1
Avatar
Descartar
Pawan Kumar Sharma

Hello @Keegan,

I need barcode feature for my system Odoo CE 10. So, Can you help me by providing your barcode code or task perform by you to implement this feature.

Thanks,

Manish Bohra

Hello @Keegan,

I am also need barcode functionality for odoo10 Community Edition. So Can you tell me how to perform this functionality.

Avatar
Parth Choksi (pch)
Mejor respuesta

Hi,

This can be done by passing this value in the context of your view: {'active_test': False,}

Like for eg:  

<filter string="Archived" name="inactive" context="{'active_test': False}" domain="[('active','=',False)]"/>


0
Avatar
Descartar
Avatar
Jerome Guerriat
Mejor respuesta

Archived records are NEVER included in any standard search..

If you use self.env['sale.order'].search([]), it will retrieve every sale order in your system.. Except the ones that are archived. This is standard.

This mean that, indeed, if you search a product over its barcode, the search function will NOT find your archived product.
However, if a SQL constrains is defined over the field, then it will still be triggered uppon insertion of a new record (meaning you won't be able to add a new product with the same barcode if a unique(barcode) constrains is set in the database)

The only way of including the archived records in a search is to specifically add a filter in the search function. 

You could add the filters ['|', ('active','=',True),  ('active','=',False)] to the search method whenever you need to search for any product (wether they are inactive or not) 

0
Avatar
Descartar
Ray Carnes

This is a great answer for programmatic searching. I think from some of the clues in the post, like "temporarily un-archive product" and "filtered archived items" that the question may be about searching via the UI.

Glen Lowe
Autor

Correct. This is a function I was hoping an end-user can do from the web UI. If not possible by default, I can possibly use the info in the previous answer to make a custom module for this? Users need to be able to find products by barcode whether archived or not.

Jerome Guerriat

you can also do that from the UI.

On the search bar, click on the "+", "filters", "add a custom filter", "active is false", "add a condition", "active is true".

This will create a filter "active is false or active is true".

you can then save the current search.

All the products will now be displayed in the tree view by default.

Glen Lowe
Autor

I know how to display all the items in the list view, but this still does not allow for searching them by barcode, try for yourself.

Jerome Guerriat

I just tested with that specific case and indeed it act kind of weird.

The barcode field is defined on product.product. So if you go in the product variants, you'll be able to search over that field.

However, on the product.template, the field barcode is defined as related to the variant_ids:

barcode = fields.Char('Barcode', oldname='ean13', related='product_variant_ids.barcode')

and indeed when a record with a related field is archived, the relation might be broken until you un-archive the record.

If you want to solve this completely using the GUI, i think there is only a dirty way of doing it :/.

- install Studio

- add a new field on the product.template form view

- go to its properties, then click on "more"

- make it computed, stored, and dependent on "barcode"

- then use this kind of code:

for product in self:

if product.product_variant_ids[0]:

product['x_permanent_barcode'] = product.product_variant_ids[0].barcode

where x_permanent_barcode is the name of the field you are defining.

By doing so, you will be able to search over the value of x_permanent_barcode, this time, even archiving the record will NOT remove that value.

However, as i said, you'll still have to use a custom filter (programmaticaly or from the GUI) to be able to search for archived records.

We never use studio, so i would of course recommand creating a custom module that fits your needs, for example by directly redifining the barcode field on product.product (remove the related=.. and make it computed), but if you specifically need to use only the GUI, this would work.

¿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