Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

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

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
accountinginvoicingaccount.moveodoo V18
103 Tampilan
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
Buang
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

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Analytic Accounting in v17 Diselesaikan
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 Diselesaikan
accounting invoicing
Avatar
Avatar
1
Sep 25
2431
Comment savoir qu'une commande est entièrement facturée ? Diselesaikan
accounting invoicing
Avatar
Avatar
1
Feb 25
2065
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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