Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

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

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
accountinginvoicingaccount.moveodoo V18
106 Weergaven
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
Annuleer
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

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Analytic Accounting in v17 Opgelost
accounting invoicing
Avatar
Avatar
Avatar
Avatar
3
jul. 25
3902
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
mrt. 25
2352
Remove bank account from supplier
accounting account.move
Avatar
Avatar
1
mrt. 25
2842
Cannot post invoice with any invoice date set in January 2024 Opgelost
accounting invoicing
Avatar
Avatar
1
sep. 25
2431
Comment savoir qu'une commande est entièrement facturée ? Opgelost
accounting invoicing
Avatar
Avatar
1
feb. 25
2065
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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