Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
2 Replies
10999 Zobrazenia
Avatar
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
Avatar
Zrušiť
Jenish M

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

Avatar
Ben
Autor Best Answer

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
Avatar
Zrušiť
Avatar
Hilar Andikkadavath
Best Answer

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
Avatar
Zrušiť
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

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

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

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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