Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

combine several lines into 1 row in print pdf odoo 15

Subscriure's

Get notified when there's activity on this post

This question has been flagged
pdfinvoiceodoo15
1825 Vistes
Avatar
Aprilia Zahratunnisa

I want to create 1 row if the invoice has similarities, for example if it has default_code 'Xirallic'. So combine several lines that have default_code 'Xirallic' in the table.



<table class="table table-condensed" style="border: 1px solid #000000; border-collapse: collapse; width: 100%; padding: 0;">

                                <thead>

                                    <tr>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 3%;">No</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 13%;">Kuantitas</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 12%;">Kode Barang</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 22%;">Nama Barang</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 8%;">Harga Satuan</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 6%;">Diskon I</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 6%;">Diskon II</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 6%;">Diskon III</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: center; width: 6%;">Diskon Tambahan</th>

                                        <th style="font-size: 14px; border: 1px solid #000000; text-align: right; width: 11%;">Jumlah</th>

                                    </tr>

                                </thead>

                                <tbody>

                                    <t t-set="sequence" t-value="1 + page_idx * items_per_page"/>

                                    <t t-foreach="chunk" t-as="line">

                                        <tr>

                                            <td style="border: 1px solid; text-align: center; font-size: 14px;">

                                                <t t-esc="sequence"/>

                                                <t t-set="sequence" t-value="sequence + 1"/>

                                            </td>

                                            <td style="text-align: center; border: 1px solid; width: 17%;">

                                                <table style="width: 100%; border: none;">

                                                    <tr>

                                                        <td style="text-align: left; border: none; padding: 0; font-size: 14px;">

                                                            <t t-if="line.product_id.default_code">

                                                                <t t-if="line.product_id.default_code.startswith('327') and 'Xirallic' in line.product_id.default_code">

                                                                    <span><t t-esc="total_xirallic_327"/> <t t-esc="line.product_uom_id.name[:2]"/></span>

                                                                </t>

                                                                <t t-elif="line.product_id.default_code.startswith('257') and 'Xirallic' in line.product_id.default_code">

                                                                    <span><t t-esc="total_xirallic_257"/> <t t-esc="line.product_uom_id.name[:2]"/></span>

                                                                </t>

                                                                <t t-elif="'Standard' in line.product_id.default_code">

                                                                    <span><t t-esc="total_standard_quantity"/> <t t-esc="line.product_uom_id.name[:2]"/></span>

                                                                </t>

                                                                <t t-elif="'Pearl' in line.product_id.default_code">

                                                                    <span><t t-esc="total_pearl_quantity"/> <t t-esc="line.product_uom_id.name[:2]"/></span>

                                                                </t>

                                                                <t t-elif="'Special' in line.product_id.default_code">

                                                                    <span><t t-esc="total_special_quantity"/> <t t-esc="line.product_uom_id.name[:2]"/></span>

                                                                </t>

                                                                <t t-else="">

                                                                    <span><t t-esc="round(line.quantity)"/> <t t-esc="line.product_uom_id.name[:2]"/></span>

                                                                </t>

                                                            </t>

                                                            <t t-else="">

                                                                <p/>

                                                            </t>

                                                        </td>

                                                        <td style="text-align: right; border: none; padding: 0; font-size: 14px;">

                                                            <t t-if="line.product_id.default_code">

                                                                <t t-if="'Xirallic' in line.product_id.default_code">

                                                                    <p/>

                                                                </t>

                                                                <t t-elif="'Standard' in line.product_id.default_code">

                                                                    <p/>

                                                                </t>

                                                                <t t-elif="'Pearl' in line.product_id.default_code">

                                                                    <p/>

                                                                </t>

                                                                <t t-elif="'Special' in line.product_id.default_code">

                                                                    <p/>

                                                                </t>

                                                                <t t-else="">

                                                                    <span><t t-esc="line.product_id.default_code.split('-', 2)[-1]"/></span>

                                                                </t>

                                                            </t>

                                                            <t t-else="">

                                                                <p/>

                                                            </t>

                                                        </td>

                                                    </tr>

                                                </table>

                                            </td>

                                            <td style="border: 1px solid; text-align: left; width: 15%; font-size: 14px;">

                                                <t t-if="line.product_id.default_code">

                                                    <t t-if="'LTSET' in line.product_id.default_code">

                                                        <t t-esc="line.product_id.default_code[:8]"/>

                                                        <t t-set="child_products" t-value="env['product.product'].search([('parent_product', '=', line.product_id.id)])"/>

                                                        <t t-foreach="child_products" t-as="child_product">

                                                            <br/>

                                                            <span><t t-esc="child_product.default_code"/></span>

                                                        </t>

                                                    </t>

                                                    <t t-elif="line.product_id.default_code.startswith('257') and 'Xirallic' in line.product_id.default_code">

                                                        <span>257-Xirallic</span>

                                                    </t>

                                                    <t t-elif="line.product_id.default_code.startswith('327') and 'Xirallic' in line.product_id.default_code">

                                                        <span>327-Xirallic</span>

                                                    </t>

                                                    <t t-elif="'Standard' in line.product_id.default_code">

                                                        <span>257-Standard</span>

                                                    </t>

                                                    <t t-elif="'Pearl' in line.product_id.default_code">

                                                        <span>257-Pearl</span>

                                                    </t>

                                                    <t t-elif="'Special' in line.product_id.default_code">

                                                        <span>257-Special</span>

                                                    </t>

                                                    <t t-else="">

                                                        <t t-esc="line.product_id.default_code"/>

                                                    </t>

                                                </t>

                                                <t t-else="">

                                                    <p/>

                                                </t>

                                            </td>

                                            <td style="border: 1px solid; font-size: 14px;">

                                                <span t-field="line.product_id.name"/>

                                            </td>

                                            <td style="border: 1px solid; text-align: right; font-size: 14px;">

                                                <span t-esc="'{:,.0f}'.format(line.price_unit)"/>

                                            </td>

                                            <td style="border: 1px solid; text-align: center; font-size: 14px;">

                                                <t t-if="line.multiple_discounts and len(line.multiple_discounts) &gt; 0">

                                                    <t t-set="discount_1" t-value="line.env['discount.discount'].browse(int(line.multiple_discounts[0]))"/>

                                                    <t t-if="doc.partner_id.id == 37191">

                                                        <t t-esc="'{:.1f}'.format(discount_1.amount) if discount_1 else '0'"/>%

                                                    </t>

                                                    <t t-elif="doc.partner_id.id != 37191">

                                                        <t t-esc="'{:.0f}'.format(discount_1.amount) if discount_1 else '0'"/>%

                                                    </t>

                                                </t>

                                                <t t-else="">

                                                    0%

                                                </t>

                                            </td>

                                            <td style="border: 1px solid; text-align: center; font-size: 14px;">

                                                <t t-if="line.multiple_discounts and len(line.multiple_discounts) > 1">

                                                    <t t-set="discount_2" t-value="line.env['discount.discount'].browse(int(line.multiple_discounts[1]))" />

                                                    <t t-esc="'{:.0f}'.format(discount_2.amount) if discount_2 else '0'" />%

                                                </t>

                                                <t t-else="">

                                                    0%

                                                </t>

                                            </td>

                                            <td style="border: 1px solid; text-align: center; font-size: 14px;">

                                                <t t-if="line.multiple_discounts and len(line.multiple_discounts) > 2">

                                                    <t t-set="discount_3" t-value="line.env['discount.discount'].browse(int(line.multiple_discounts[2]))" />

                                                    <t t-esc="'{:.0f}'.format(discount_3.amount) if discount_3 else '0'" />%

                                                </t>

                                                <t t-else="">

                                                    0%

                                                </t>

                                            </td>

                                            <td style="border: 1px solid; text-align: center; font-size: 14px;">

                                                <span t-esc="'{:.0f}'.format(line.discount_tambahan)"/>%

                                            </td>

                                            <td style="border: 1px solid; text-align: right; font-size: 14px;">

                                                <span t-esc="'{:,.0f}'.format(line.price_total)"/>

                                            </td>

                                        </tr>

                                    </t>

                                </tbody>

                                <tfoot t-if="page_idx == page_count - 1">

                                    <tr>

                                        <td colspan="9" class="text-right">

                                            <b>Total</b>

                                        </td>

                                        <td style="border: 1px solid #000000; text-align: right; font-size: 14px;">

                                            <span t-esc="'{:,.0f}'.format(round(doc.amount_total, 2))"/>

                                        </td>

                                    </tr>

                                </tfoot>

                            </table>

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
PDF Invoice line overflow
pdf invoice
Avatar
Avatar
Avatar
2
de jul. 25
1674
Quote PDF Spacing & Layout
pdf invoice
Avatar
Avatar
1
d’ag. 25
2203
How to apply a customized invoice pdf to an email template
pdf invoice
Avatar
Avatar
1
de juny 24
3457
Odoo Invoice PDF download from External API
pdf invoice odoo17
Avatar
0
d’oct. 24
2998
Header and footer not showing in PDF Solved
pdf invoice v14
Avatar
Avatar
Avatar
Avatar
Avatar
11
d’oct. 24
34587
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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