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

Invoice report section issue in line item

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
attachaccounting
3 Replies
1396 Tampilan
Avatar
Gowtham A

In this code, the section is printed after the line items. As shown in the image I shared, it should appear the related line items. Please help me fix it


<tbody class="invoice_tbody" style="border-bottom:2px solid gainsboro;">
<t t-set="current_subtotal" t-value="0"/>
<t t-set="current_subtotal_TTC" t-value="0"/>
<t t-foreach="o.invoice_line_ids" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
<t t-set="current_subtotal_TTC" t-value="current_subtotal_TTC + line.price_total"/>
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="line.display_type == 'product'" name="account_invoice_line_accountable">
<td name="account_invoice_line_name">
<span t-field="line.name"/>
</td>
<!-- <td class="d-none">-->
<!-- <span t-field="line.origin"/>-->
<!-- </td>-->
<td class="text-end">
<span t-field="line.quantity"/>
<span t-field="line.product_uom_id" groups="uom.group_uom"/>
</td>
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.price_unit"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td t-if="display_discount"
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.discount"/>
</td>
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))"/>
</td>
<td style="border-top-style: hidden;" class="text-end o_price_total">
<span t-field="line.price_subtotal"/>
</td>
<td style="border-top-style: hidden;" class="text-end o_price_total">
<span t-field="line.price_total"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td t-att-colspan="colspan" style="font-weight:bold;">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
<t t-set="current_subtotal_TTC" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'"
style="font-size:11.5px !important;font-weight:bold;">
<td t-att-colspan="colspan" style="font-weight:bold; white-space: pre-wrap;">
<span t-esc="line.name"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or o.invoice_line_ids[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-end">
<td></td>
<td></td>
<td></td>

<td>
<strong class="mr16">Sous-total</strong>

</td>
<td>
<span
t-esc="current_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
<td>
<span
t-esc="current_subtotal_TTC"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
</tr>
</t>
</t>
</tbody>
0
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi,

You need to move the section and note line checks (line.display_type == 'line_section' and line.display_type == 'line_note') above the product line rendering block.


Please refer to the code below:


<tbody class="invoice_tbody" style="border-bottom:2px solid gainsboro;">
<t t-set="current_subtotal" t-value="0"/>
<t t-set="current_subtotal_TTC" t-value="0"/>
<t t-foreach="o.invoice_line_ids" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
<t t-set="current_subtotal_TTC" t-value="current_subtotal_TTC + line.price_total"/>
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="line.display_type == 'line_section'">
<td t-att-colspan="colspan" style="font-weight:bold;">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
<t t-set="current_subtotal_TTC" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'"
style="font-size:11.5px !important;font-weight:bold;">
<td t-att-colspan="colspan" style="font-weight:bold; white-space: pre-wrap;">
<span t-esc="line.name"/>
</td>
</t>
<t t-if="line.display_type == 'product'" name="account_invoice_line_accountable">
<td name="account_invoice_line_name">
<span t-field="line.name"/>
</td>
<!-- <td class="d-none">-->
<!-- <span t-field="line.origin"/>-->
<!-- </td>-->
<td class="text-end">
<span t-field="line.quantity"/>
<span t-field="line.product_uom_id" groups="uom.group_uom"/>
</td>
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.price_unit"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td t-if="display_discount"
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.discount"/>
</td>
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))"/>
</td>
<td style="border-top-style: hidden;" class="text-end o_price_total">
<span t-field="line.price_subtotal"/>
</td>
<td style="border-top-style: hidden;" class="text-end o_price_total">
<span t-field="line.price_total"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or o.invoice_line_ids[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-end">
<td></td>
<td></td>
<td></td>
<td>
<strong class="mr16">Sous-total</strong>
</td>
<td>
<span
t-esc="current_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
<td>
<span
t-esc="current_subtotal_TTC"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
</tr>
</t>
</t>
</tbody>


Hope it helps.

0
Avatar
Buang
Avatar
Gowtham A
Penulis Jawaban Terbai

I have tried your code but still section is appeared at last, any ways thank you

0
Avatar
Buang
Avatar
STAFFINSIDE
Jawaban Terbai

Maybe try to move the line.display_type == 'line_section' logic before the main <tr> is rendered so that the section row prints before the associated product lines. Like this:

<tbody class="invoice_tbody" style="border-bottom:2px solid gainsboro;">
    <t t-set="current_subtotal" t-value="0"/>
    <t t-set="current_subtotal_TTC" t-value="0"/>
    <t t-foreach="o.invoice_line_ids" t-as="line" t-index="line_index">
       
        <!-- SECTION HEADER FIRST -->
        <t t-if="line.display_type == 'line_section'">
            <tr class="bg-200 font-weight-bold o_line_section">
                <td t-att-colspan="colspan" style="font-weight:bold;">
                    <span t-field="line.name"/>
                </td>
            </tr>
            <t t-set="current_section" t-value="line"/>
            <t t-set="current_subtotal" t-value="0"/>
            <t t-set="current_subtotal_TTC" t-value="0"/>
        </t>

        <!-- NOTE LINE -->
        <t t-if="line.display_type == 'line_note'">
            <tr class="font-italic o_line_note">
                <td t-att-colspan="colspan" style="font-weight:bold; white-space: pre-wrap;">
                    <span t-esc="line.name"/>
                </td>
            </tr>
        </t>

        <!-- PRODUCT LINE -->
        <t t-if="line.display_type == 'product'" name="account_invoice_line_accountable">
            <tr>
                <td name="account_invoice_line_name">
                    <span t-field="line.name"/>
                </td>
                <td class="text-end">
                    <span t-field="line.quantity"/>
                    <span t-field="line.product_uom_id" groups="uom.group_uom"/>
                </td>
                <td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                    <span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
                </td>
                <td t-if="display_discount"
                    t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                    <span t-field="line.discount"/>
                </td>
                <td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                    <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))"/>
                </td>
                <td class="text-end o_price_total" style="border-top-style: hidden;">
                    <span t-field="line.price_subtotal"/>
                </td>
                <td class="text-end o_price_total" style="border-top-style: hidden;">
                    <span t-field="line.price_total"/>
                </td>
            </tr>
            <!-- Update subtotals -->
            <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
            <t t-set="current_subtotal_TTC" t-value="current_subtotal_TTC + line.price_total"/>
        </t>

        <!-- SUBTOTAL AFTER LAST LINE IN SECTION -->
        <t t-if="current_section and (line_index + 1 == len(o.invoice_line_ids) or o.invoice_line_ids[line_index + 1].display_type == 'line_section')">
            <tr class="is-subtotal text-end">
                <td></td><td></td><td></td>
                <td><strong class="mr16">Sous-total</strong></td>
                <td>
                    <span t-esc="current_subtotal"
                          t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
                </td>
                <td>
                    <span t-esc="current_subtotal_TTC"
                          t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
                </td>
            </tr>
        </t>

    </t>
</tbody>

0
Avatar
Buang
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
Facing An Issue In Image Classification Model Optimization.
attach accounting
Avatar
0
Okt 25
303
{+56} (Latam Telefono CL) ¿Cómo llamar a Latam en Chile?
attach accounting chrome
Avatar
0
Nov 25
12
(Latam Chile) ¿Cómo llamar a Latam Chile desde celular?
action attach accounting
Avatar
0
Nov 25
39
𝓛𝓲𝓰𝓪𝓻 ⒷⓇ }Como falar com British Airways pelo exterior?
attach
Avatar
0
Nov 25
1
How can I access the details of the Inventory Variation posted at month end in Odoo 19?
action attach accounting chrome
Avatar
0
Nov 25
7
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