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
    • 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
    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

Lines in Sale Orders don't respect order in which they are entered

Suscribirse

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

Se marcó esta pregunta
invoicesequenceorderlinesopenerp7
3 Respuestas
9903 Vistas
Avatar
Santi

When I enter new lines in Sale Orders they are ordered correctly, but as soon as I click either the update or save buttons, the sequence in which the lines where ordered gets messed up.

I would like the lines to respect the order in which I enter them. How can I accomplish this? or am I the only one this issue?

1
Avatar
Descartar
Avatar
Zbik
Mejor respuesta

See: How to reorder lines in a quotation? 

UPDATE:

or you change default sort oder for sale.order.line from

_order = 'order_id desc, sequence, id' 

 to other, which suits you. For example:

class sale_order_line(models.Model): 
   _inherit = 'sale.order.line'
   _order = 'order_id desc, id'

 


-1
Avatar
Descartar
Santi
Autor

Thanks zbik, I already saw that, and use it on a daily basis, but that does not solve the core problem I have.

Santi
Autor

My problem is that the lines do not maintain the order in which they are entered. I initially thought it was a misbehavior caused by one of the modules I had installed, but I created a new empty database with the very basic official modules installed and the same problem appeared to occur....so I'm really surprised I'm the only one complaining about it.

Zbik

@Rachid answer is for you, sequence field value determines order.

Zbik

... and ... if you drag and drop the default sequence value change.

Santi
Autor

The behavior I've noticed is the following, if you enter each product line continuously by clicking "Add an item" and add all items one after another without abandoning the "Create: Order Lines" form by clicking "Save & New", once you're done entering them all this way and click "(update)" or "Save" the Sale Order, the items respect the order in which they where entered. BUT, if for example you add an item by clicking "Add an item" then click "Save & Close" on the ""Create: Order Lines", once you start adding items again, any new items you add will appear after the first line entered in the Sale Order one you save or update it, instead of being places after the LAST line in the sequence they have been added. This behaviour is very annoying specially when creating a quotation with many items, it can get all messed up and you have to drag and drop each item to place them in the intended order.

Santi
Autor

Yes, if I drag and drop the sequence changes....but I shouldn't have to drag and drop! that's the thing. The lines should be respect the order in which they are entered...one after the other. Dragging and dropping should only be used if you want to modify the intended sequence later on.

Zbik

answer updated

Santi
Autor

Thanks. I had tried that as well, that way the order of the lines work as it should....but, drag and drop does not work, since the sequence of the lines isn't taken into account. So I discarded that option as well....

Santi
Autor

I have been further troubleshooting this, and there's some kind of obvious bug in the way the sequencing works. If you look in the database (PGAdmin3) in sale_order_line table, you'll see that if you add several items, the sequence increments, for example 10 (Item 1), 11 (Item 2), 12 (Item 3), 13 (Item 4)....but once you save or update the Sale Order, and then edit and add new lines, the sequence always starts at 11, for example 10 (Item 1), 11 (Item 5), 12 (Item 6), 13 (Item 2), 14 (Item 3), 15 (Item 4) .......when it should be as follows 10 (Item 1), 11 (Item 2), 12 (Item 3), 13 (Item 4), 14 (Item 5), 15 (Item 6)

Santi
Autor

Does anyone else have this issue...or is it just me? As I mentioned earlier, I tried on a new empty database...and the same issue applies, so I don't think it's only me....

Zbik

In my system V8 all sequences value = 10, without drag and drop. V7 or V8? Field sequence is INTEGER can not change for no reason!

Santi
Autor

Ok, you are right zbik, I narrowed it down to the module "nan_product_pack" being the one causing this misbehavior. The module increments the sequence per line, and in the process messes up the order. For some reason I installed this module in the new database as well and forgot I had done so later on....sorry for all the fuss, and thanks for you help zbik and Rachid, I'll try to figure out how to fix "nan_product pack" as it's an essential module in our business...

Avatar
Santi
Autor Mejor respuesta


Hi Rachid (sorry, I can't comment your post, as I need 50 karma points to do so),

I'm aware of the default sequence number, and that you can change it in sales.py file...or through a module. I'm also aware that you can reorder the lines by dragging and dropping them manually after they've been messed up. But what I don't understand is why the lines don't stay in the order I've added them by default.

For example, I add:

Line 1

Line 2

Line 3

I expect it to stay as:

Line 1

Line 2 

Line 3

and not as this, which is the actual behaviour:

Line 1

Line 3

Line 2

There doesn't seem to be much logic behind this default behaviour.

So far I haven't found many posts complaining about this issue, so I'm starting to suspect it might be a behaviour specific to my OpenERP installation. Is anyone else facing this issue (line order being messed upon save or update of the order/invoice/picking)?



1
Avatar
Descartar
Tommy Lo

the same we are facing at Odoo 11

Avatar
Rachid
Mejor respuesta

you can sort them with using the sequence field

the sequence take a default number=10

so if you want to make a line first you can put a minum sequence number like:

1st line : sequence=8

2nd line : sequence=9

3rd line : sequence=10

 

 

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
Invoice lines and sale order lines relation Resuelto
invoice order lines
Avatar
Avatar
2
jul 20
28349
How to export data by sequence?
invoice export data sequence order
Avatar
Avatar
Avatar
Avatar
3
feb 25
5348
How to change Invoice sequence via xml in Odoo 15 or newer?
invoice sequence
Avatar
0
sept 24
2098
Odoo 17.1 - How to never reset invoice number
invoice sequence
Avatar
Avatar
2
mar 24
4021
How to select manually a sequence for an invoice? Resuelto
invoice sequence
Avatar
Avatar
2
feb 23
4631
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