Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
2 Răspunsuri
10998 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Jenish M

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

Imagine profil
Ben
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Hilar Andikkadavath
Cel mai bun răspuns

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
Imagine profil
Abandonează
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!

Înscrie-te
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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