Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

create a div that can be repeated on every page of the report on odoo 11 Entreprise

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
2 Odpowiedzi
11010 Widoki
Awatar
Ben

Hi, I would like to know when we create a custom report is it possible to create a block (div) that can be repeated on all pages of the report without it being in the header or in the footer?

If yes; how to do it ?

I work on odoo 11 Enterprise version

0
Awatar
Odrzuć
Jenish M

Hello Ben,
Did you find a way to repeat the div.

Awatar
Ben
Autor Najlepsza odpowiedź

In red my header and in blue the content of the page so my header overlaps with the content of the page and even I try to change the height of the header it does not work.

Here is my code, if it can help

<odoo>

<report
    id="account_invoices"
    model="sale.order"
    string="Pro-forma"
    report_type="qweb-pdf"
    name="sale_discount.report_saleorder_pro_forma_t"
    file="sale_discount.report_saleorder_pro_forma_t"
    attachment_use="True"
    attachment="(object.state in ('open','paid')) and
        ('INV'+(object.number or '').replace('/','')+'.pdf')"
/>


<template id="report_invoicess">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="sale_discount.internal_layout_test">
                <div class="header" style="border:1px solid #1d0296;">
                    <div bottom="100px;">
                        <div class="col-xs-12" style="border:1px solid #cccccc;">
                            <div class="col-xs-6"  style="padding:20px">
                            <h2>
                                <t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
                                    <span t-if="doc.state not in ['draft','sent']">Order # </span>
                                    <span t-if="doc.state in ['draft','sent']">Quotation # </span>
                                </t>
                                <t t-if="env.context.get('proforma', False) or is_pro_forma">
                                    <span>Proforma N°.- </span>
                                </t>
                                <span t-field="doc.name"/>
                            </h2>
                            </div>
                            <div class="col-xs-5 col-xs-offset-1"  style="padding:20px">
                                <p><strong>Détails du client</strong></p>
                                <div t-field="doc.partner_id"
                                    t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
                                <p t-if="doc.partner_id.vat"><t t-esc="doc.company_id.country_id.vat_label or 'TIN'"/>: <span t-field="doc.partner_id.vat"/></p>
                            </div>
                        </div>

                        <div class="col-xs-12" style="border:1px solid #000000; padding:20px">
                            <div t-if="doc.client_order_ref" class="col-xs-3">
                                <strong>Reference Client:</strong>
                                <p t-field="doc.client_order_ref"/>
                            </div>
                            <div t-if="doc.confirmation_date and doc.state not in ['draft','sent']" class="col-xs-3">
                                <strong>Date de Confirmation:</strong>
                                <p t-field="doc.confirmation_date" t-field-options='{"format": "d/M/y"}'/>
                            </div>
                            <div t-if="doc.date_order and doc.state in ['draft','sent']" class="col-xs-3">
                                <strong>Date de la Proforma:</strong>
                                <p t-field="doc.date_order" t-field-options='{"format": "d/M/y"}'/>
                            </div>
                            <div t-if="doc.user_id.name" class="col-xs-3">
                                <strong>Vendeur:</strong>
                                <p t-field="doc.user_id"/>
                            </div>
                            <div t-if="doc.user_id.name" class="col-xs-3">
                                <strong>Contact N°:</strong>
                                <p t-field="doc.user_id.phone"/>
                            </div>
                            <div t-if="doc.user_id.name" class="col-xs-3">
                                <strong>Email:</strong>
                                <p t-field="doc.user_id.login"/>
                            </div>
                        </div>
                        <div class="col-xs-12" style="border:1px solid #000000; height:25px;">
                    </div>
                </div>
                </div>
                
                 <div class="page" >
            <!--div class="oe_structure"/-->
        
            <!-- Is there a discount on at least one line? -->
            <t t-set="display_discount" t-value="any([l.discount for l in doc.order_line])"/>


            <t t-foreach="doc.order_lines_layouted()" t-as="page">
                <!--table class="table table-condensed" style="border:1px solid #cccccc;" border="1"-->
                <div width="100%"  heigth="auto" style="border:0px solid #000000;">
                <table class="table table-condensed" >
                    <thead >
                        <tr>
                            <th class="text-center" style="border-right:1px solid #000000">Description</th>
                            <th class="text-center" style="border-right:1px solid #000000">Quantité</th>
                            <th class="text-center" style="border-right:1px solid #000000">Prix Unitaire</th>
                            <th t-if="display_discount" class="text-center" groups="sale.group_discount_per_so_line" style="border-right:1px solid #000000">REMISE.(%)</th>
                            <th class="text-center" style="border-right:1px solid #000000">T.V.A</th>
                            <th class="text-center" groups="sale.group_show_price_subtotal">COUT H.T.</th>
                            <!--th class="text-center">COUT T.T.C</th-->
                        </tr>
                   </thead>
                   <tbody class="sale_tbody">
                        <t t-foreach="page" t-as="layout_category">

                            <t t-if="layout_category_size > 1 or page_size > 1" groups="sale.group_sale_layout">
                                <tr class="active">
                                    <td colspan="7" style="font-weight: bold; border-bottom: 0px solid black;">&amp;bull;
                                        <t t-esc="layout_category['name']"/>
                                    </td>
                                </tr>
                            </t>

                            <!--t t-set="i" t-value="1"/>
                                <tr t-foreach="o.order_line" t-as="l">
                                     <Check Condition and break>
                                    <td> <span t-esc="i"/></td>
                                    <t t-set="i" t-value="i+1"/>
                                </tr>
                            </t-->

                            <!-- Lines associated -->
                            <t t-foreach="layout_category['lines']" t-as="l">
                                <tr>
                                    <td><span t-field="l.name"/></td>
                                    <td class="text-right">
                                        <span t-field="l.product_uom_qty"/>
                                        <span t-field="l.product_uom" groups="product.group_uom"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-field="l.price_unit"/>
                                    </td>
                                    <td t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
                                        <span t-field="l.discount"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_id))"/>
                                    </td>
                                    <td class="text-right" groups="sale.group_show_price_subtotal" style="background-color: transparent !important;">
                                        <span t-field="l.price_subtotal"
                                            t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                    </td>
                                    <!--td class="text-right" style="background-color: transparent !important;">
                                        <span t-field="l.price_total"
                                            t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                    </td-->
                                </tr>
                            </t>
                            <!--t t-if="page_index &lt; page_size - 1" groups="sale.group_sale_layout">
                    <p style="page-break-before:always;"> </p>
                            </t-->

                            <t t-if="(layout_category_size > 1 or page_size > 1) and layout_category['subtotal']" groups="sale.group_sale_layout">
                                <tr class="text-right">
                                    <td colspan="6">
                                        <strong>Subtotal: </strong>
                                        <t t-set="subtotal" t-value="sum(line.price_subtotal for line in layout_category['lines'])"/>
                                        <span t-esc="subtotal" t-options="{'widget': 'monetary', 'display_currency': doc.pricelist_id.currency_id}"/>
                                    </td>
                                </tr>
                            </t>

                        </t>
                    </tbody>
                </table>

                <table width="100%" style="border-color:#ffffff !important">
                    <tr>
                        <td style="border-color:#ffffff; border-left-color:#ffffff;" width="65%">
                            <p style="padding:5px"><strong>Montant en lettres : </strong><span t-field="doc.montant_lettre"/></p>
                        </td>
                        <td style="background-color: transparent !important;border-color:#ffffff;" width="35%">
                            <table class="table table-condensed" style="min-width:200px;max-width: 350px;" border="">
                                    <tr class="border-black"  t-if="display_discount"  style="border:1px solid #000000">
                                        <td><strong>Montant sans Remise</strong></td>
                                        <td class="text-right"  style="background-color: transparent !important;">
                                            <span t-field="doc.amount_undiscount"
                                                t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                        </td>
                                    </tr>
                                    <tr class="border-black"  t-if="display_discount"  style="border:1px solid #000000;">
                                        <td><strong>Remise</strong></td>
                                        <td class="text-right"  style="background-color: transparent !important;">
                                        <span t-field="doc.total_discount"
                                                    t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                        </td>
                                    </tr>
                                    <tr class="border-black"  style="border:1px solid #000000">
                                        <td><strong>Total H.T.</strong></td>
                                        <td class="text-right"  style="background-color: transparent !important;">
                                           <span t-field="doc.amount_untaxed"
                                                 t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                        </td>
                                    </tr>
                                    <t t-foreach="doc._get_tax_amount_by_group()" t-as="amount_by_group">
                                        <tr style="border:1px solid #000000;">
                                            <t t-if="amount_by_group[3] == 1 and doc.amount_untaxed == amount_by_group[2]">
                                                <td>
                                                    <span t-esc="amount_by_group[0]"/>
                                                    <span>&amp;nbsp;<span>on</span>&amp;nbsp;<t t-esc="amount_by_group[2]" t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/></span>
                                                    </td>
                                                    <td class="text-right" style="background-color: transparent !important;">
                                                        <span t-esc="amount_by_group[1]"
                                                            t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                                    </td>
                                                </t>
                                                <t t-else ="">
                                                <td>
                                                    <span t-esc="amount_by_group[0]"/>
                                                </td>
                                                <td class="text-right" style="background-color: transparent !important;">
                                                    <span t-esc="amount_by_group[1]"
                                                        t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                                </td>
                                            </t>
                                       </tr>
                                    </t>
                                    <tr class="border-black"  style="border:1px solid #000000;">
                                        <td><strong>Total</strong></td>
                                        <td class="text-right"  style="background-color: transparent !important;">
                                            <span t-field="doc.amount_total"
                                                t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                        </td>
                                    </tr> 

                                    <tr class="border-black"  t-if="(doc.currency_id.name == 'CDF')" style="border:1px solid #000000;">
                                        <td style="border-color:#ffffff;background-color: transparent !important;"></td>
                                    </tr> 

                                    <tr class="border-black"  t-if="(doc.currency_id.name == 'CDF')" style="border:1px solid #000000;">
                                        <td><strong>Taux</strong></td>
                                        <td class="text-right"  style="background-color: transparent !important;">
                                            <span t-field="doc.currency_id.rate"
                                                t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
                                        </td>
                                    </tr> 
                                    <tr class="border-black"  t-if="(doc.currency_id.name == 'CDF')" style="border:1px solid #000000;">
                                        <td><strong>Total USD</strong></td>
                                        <td class="text-right"  style="background-color: transparent !important;">
                                            <t t-set="subtotalusd" t-value="(doc.amount_total / doc.currency_id.rate)"/>
                                            <span t-esc="subtotalusd" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
                                            <!--span t-field="doc.currency_id.round(amount_total)"
                                                t-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/-->
                                        </td>
                                    </tr> 
                                </table>
                            </td>   
                        </tr>
                        <tr>
                            <td height="10px;" style="border-color:#ffffff;background-color: transparent !important;"></td>
                        </tr>
                    </table>
                    </div>

                <div class="col-xs-12" style="margin-top:10%;">
                    <table style="border-color:#ffffff !important">
                        <tr>
                            <td width="65%" style="border-color:#ffffff;">
                                <table class="table table-condensed" style="min-width: 200px;max-width: 350px;">
                                    <tr class="border-black" style="border:1px solid #000000;">
                                        <td><strong>Prix Rendu:</strong></td>
                                        <td class="text-right" style="background-color: transparent !important;">
                                            <span t-field="doc.prix_rendu"/>
                                        </td>
                                    </tr>
                                    <tr class="border-black" style="border:1px solid #000000;">
                                        <td><strong>Modalité de paiement :</strong></td>
                                        <td class="text-right" style="background-color: transparent !important;">
                                            <span t-field="doc.mode_paiement"/>
                                        </td>
                                    </tr>
                                    <tr class="border-black" style="border:1px solid #000000;">
                                        <td><strong>Validité :</strong></td>
                                        <td class="text-right" style="background-color: transparent !important;">
                                            <span t-field="doc.valide_livraison"/>
                                        </td>
                                    </tr>
                                    <tr class="border-black" style="border:1px solid #000000;">
                                        <td><strong>Livraison :</strong></td>
                                        <td class="text-right" style="background-color: transparent !important;">
                                            <span t-field="doc.livraison"/>
                                        </td>
                                    </tr>
                                    <tr class="border-black" style="border:1px solid #000000;">
                                        <td><strong>Termes et Conditions : -  </strong></td>
                                        <td style="background-color: transparent !important;">
                                            <span><strong>1:- En cas d'exoneration à la T.V.A. veuillez fournir la preuve svp.</strong></span><br/>
                                            <span><strong>2:- Tous les frais bancaires sont à la charge du Client</strong></span><br/>
                                            <span><strong>3:- Tout Client acheteur des produits de sécurité/radio/rabx/réseau est tenu d'obtenir ses propres 
                                            </strong></span>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="35%" style="background-color: transparent !important;border-color:#ffffff;"></td>
                            
                        </tr>
                    </table>
                </div>
                <t t-if="page_index &lt; page_size - 1" groups="sale.group_sale_layout">
                    <p style="page-break-before:always;"> </p>
                </t>
            </t>
            <div class="oe_structure"/>
            
        </div>



            </t>
        </t>
    </t>
</template>

<template id="report_saleorder_pro_forma_t">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="doc">
            <t t-call="sale_discount.report_invoicess" t-lang="doc.partner_id.lang"/>
        </t>
    </t>
</template>


    <template id="internal_layout_test">
        <!-- Multicompany -->
        <t t-if="o and 'company_id' in o">
            <t t-set="company" t-value="o.company_id"/>
        </t>
        <t t-if="not o or not 'company_id' in o">
            <t t-set="company" t-value="res_company"/>
        </t>
        <div class="article">
          <t t-raw="0" />
        </div>

        <div class="footer" style="border-top:1px solid #000000">
            <div>
                <img class="img img-responsive" src="/sale_discount/static/img/partners.PNG" /> 
            </div> 
            <div class="text-center" style="border-top:1px dotted #000000">
                <ul class="list-inline mb4">
                    <li t-if="company.street"><span t-field="company.street"/></li>
                </ul>
                <ul class="list-inline mb4">
                    <li t-if="company.phone">Phone: <span t-field="company.phone"/></li>
                    <li t-if="company.email">Email: <span t-field="company.email"/></li>
                    <li t-if="company.website">Web: <span t-field="company.website"/></li>
                    <li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'TIN'"/>: <span t-field="company.vat"/></li>
                </ul>

                <div name="financial_infos">
                    <span t-field="company.report_footer"/>
                </div>

                <div class="text-muted">
                    Page: <span class="page"/> / <span class="topage"/>
                </div>
            </div>
        </div>
    </template>


</odoo>

 


0
Awatar
Odrzuć
Awatar
Hilar Andikkadavath
Najlepsza odpowiedź

Goto addons/web/views/report_templates.xml you can see the report_layout template inherit or override the same and do your needs. Include your div here and this will be used for all reports repeatedly, or make your div as a new template and call like header and footer did.

0
Awatar
Odrzuć
Jenish M

I have created my div in other template and when i call using t-call it won't repeat.
Do you know why

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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