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

Section line on customer invoice not displayed in invoice lines (but appears in accounting entries)

Suscribirse

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

Se marcó esta pregunta
accountinginvoicingaccount.moveodoo V18
104 Vistas
Avatar
harenakely

Hello everyone,

I’m working on Odoo 18 (enterprise) and I customized the invoice creation logic in sale.order to insert section lines grouping invoice lines by picking (delivery order).

The goal is:

  • When a customer invoice is created from multiple deliveries,

  • For each delivery order, insert a section line containing:

    "Order No. X – Delivery Note No. Y dated Z"

  • Then insert all invoice lines related to that picking under that section.

The section lines should appear in the invoice form view (as display_type='line_section'), and also in accounting entries. Here is the code that I did:

def _create_invoices(self, grouped=False, final=False):
        invoices = super()._create_invoices(grouped=grouped, final=final)

        for inv in invoices:

            lines_by_picking = {}

            for line in inv.invoice_line_ids:
                line_vals = line.copy_data()[0]

                picking = line.sale_line_ids.mapped("move_ids").mapped("picking_id")
                if picking:
                    picking = picking[0]
                    lines_by_picking.setdefault(picking, []).append(line_vals)

            inv.write({"invoice_line_ids": [(5, 0, 0)]})
            new_lines = []
            for picking, line_vals_list in lines_by_picking.items():
                section_name = _(
                    "Order No. %s - Delivery Note No. %s dated %s"
                ) % (
                    picking.sale_id.name,
                    picking.name,
                    picking.delivery_date.date().strftime('%d/%m/%Y') if picking.delivery_date else "",
                )
                print(section_name)
                new_lines.append((
                    0, 0, {
                        "display_type": "line_section",
                        "name": section_name
                    }
                ))
                for vals in line_vals_list:
                    vals.pop("sequence", None)
                    new_lines.append((0, 0, vals))
            inv.write({"invoice_line_ids": new_lines})

        return invoices

What works:

  • The section name is correctly generated (I printed it in the logs).

  • In the accounting entries, the section line does exist, with the correct name and display_type='line_section'.

  • When generating an invoice from a single delivery, it sometimes appears correctly.

The problem:

The section line does NOT appear in the invoice form view (account.move → tab "Invoice Lines") even though it:

  • exists in the database

  • has display_type='line_section'

  • appears under "Accounting entries" with the correct name

In the form view, the widget used is:

<field name="name" widget="section_and_note_text" optional="show"/>

But the section text stays blank / invisible.

What I suspect:

I think the issue might be related to:

  1. The way invoice lines are recreated ((5,0,0) then reinserting everything)

  2. The widget section_and_note_text not refreshing correctly

  3. The fact that invoice lines created programmatically may miss some required fields or context

  4. A missing value that the section widget expects, but I’m unsure which one

Expected behavior:

  • The section line should display normally in the invoice UI, as any manual section line does.

Questions:

  1. Is there something missing when creating a section invoice line programmatically?

  2. Does the section widget require a specific field value other than display_type='line_section' and name?

  3. Is recreating all invoice lines ((5,0,0)) the wrong approach in this case?

  4. Is there a better way to group invoice lines by picking when the invoice is generated?

Any help or insight on why the section line does not appear in the invoice form (while it exists in accounting entries) would be greatly appreciated.

Thanks in advance!

0
Avatar
Descartar
Codesphere Tech

Hello,
This app is not fulfil the purpose you shared but it helps to understand the section grouping..
https://apps.odoo.com/apps/modules/18.0/cst_sale_orderline_grouping
Hope it is help.
Thanks

¿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
Analytic Accounting in v17 Resuelto
accounting invoicing
Avatar
Avatar
Avatar
Avatar
3
jul 25
3901
Journal Entry PB-Tab/2025/00007 is not valid. In order to proceed, the journal items must include one and only one outstanding payments/receipts account.
accounting invoicing
Avatar
Avatar
1
mar 25
2352
Remove bank account from supplier
accounting account.move
Avatar
Avatar
1
mar 25
2841
Cannot post invoice with any invoice date set in January 2024 Resuelto
accounting invoicing
Avatar
Avatar
1
sept 25
2431
Comment savoir qu'une commande est entièrement facturée ? Resuelto
accounting invoicing
Avatar
Avatar
1
feb 25
2065
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