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 pub
    • 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
    • Cervecería
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y soporte técnico
    • 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

How can I sort (reorder) documents in List View

Suscribirse

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

Se marcó esta pregunta
listreorderingdocuments
2 Respuestas
9321 Vistas
Avatar
Cihan Altinay

I am not able to reorder the view of documents under Knowledge->Documents in the list view. I can click on the columns and a request is sent to the server but the result looks exactly the same (seemingly unsorted by anything).

The server logs only show the following line anytime I click on any column: webgeo werkzeug: 127.0.0.1 - - [<datetime>] "POST /web/dataset/search_read HTTP/1.1" 200 -

If it makes a difference: there is no filestore but the documents are stored in the DB (default) and I'm using the OpenERP 7.0-20140116 package on debian.

0
Avatar
Descartar
Avatar
Cihan Altinay
Autor Mejor respuesta

Alright I dug into the source myself and found that the reason I can't sort is the document plugin.

More specifically, the search() method in addons/document/document.py (around line 105) overwrites the search results in order to see if the user is allowed to read the actual directory of the document.

My fix was to apply the same strategy as in base/ir/ir_attachment.py to return the filtered ids but ordered as requested:

ids = [id for id in orig_ids if id in ids]

Now I'm pretty new to openERP so if this is the wrong place to report this, could someone please let me know where to do this instead so it gets fixed upstream?

Here's a full patch (can't attach due to karma<30):

--- a/addons/document/document.py   2012-12-27 12:06:00.000000000 +1000
+++ b/addons/document/document.py   2014-01-18 15:18:33.000000000 +1000
@@ -85,14 +85,14 @@

     def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
         # Grab ids, bypassing 'count'
-        ids = super(document_file, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=False)
-        if not ids:
+        orig_ids = super(document_file, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=False)
+        if not orig_ids:
             return 0 if count else []

         # Filter out documents that are in directories that the user is not allowed to read.
         # Must use pure SQL to avoid access rules exceptions (we want to remove the records,
         # not fail), and the records have been filtered in parent's search() anyway.
-        cr.execute('SELECT id, parent_id from ir_attachment WHERE id in %s', (tuple(ids),))
+        cr.execute('SELECT id, parent_id from ir_attachment WHERE id in %s', (tuple(orig_ids),))

         # cont a dict of parent -> attach
         parents = {}
@@ -108,6 +108,8 @@
         for parent_id in visible_parent_ids:
             ids.extend(parents[parent_id])

+        # sort result according to the original sort ordering
+        ids = [id for id in orig_ids if id in ids]
         return len(ids) if count else ids

     def copy(self, cr, uid, id, default=None, context=None):
1
Avatar
Descartar
Martin Varela

Thanks! I was dealing with the same problem.

Avatar
Martin Varela
Mejor respuesta

Thanks! I was dealing with the same problem.

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 13 don't have Documents?
documents
Avatar
Avatar
Avatar
Avatar
Avatar
4
jul 23
8924
how to remove the duplicate number of elements in list? Resuelto
list
Avatar
Avatar
Avatar
Avatar
Avatar
5
dic 23
19959
what is the name of this app Resuelto
documents
Avatar
Avatar
1
dic 21
3512
Automated action to delete a record? (odoo.sh v13) Resuelto
reordering
Avatar
Avatar
1
jun 20
6632
Documents App - add the old records in the sysyem
documents
Avatar
0
may 20
3331
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