Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Customize Report problem

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
pdf
3 Réponses
1623 Vues
Avatar
Jitesh Jeram

Hi,

I have inserted new columns into the pdf quote

  • Now two of the other coloumns are not printing correctly.
  • I also need to get the numbers all looking the same, besides the discount column.

https://ibb.co/C5kcZGMK


Current Code:

<data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[3]" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_taxes']" meta-name="th_taxes" meta-class="text-end"/>

    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_discount']" meta-name="th_discount" meta-t-if="display_discount" meta-class="text-end">

      <th class="text-center"> Price Excl

      </th>

      <th name="th_taxes" class="text-center">VAT</th>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//th[@name='th_quantity']" meta-name="th_quantity" meta-class="text-end">

      <th name="th_quantity" class="text-end" style="text-align: center;">Qty</th>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//th[@name='th_subtotal']/span"/>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//th[@name='th_subtotal']" meta-name="th_subtotal" meta-class="text-end">

      <span class="text-center">Price Incl</span>

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_quantity']" meta-name="td_quantity" meta-class="text-end text-nowrap"/>

    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_name']" meta-name="td_name">

      <td name="td_quantity" class="text-center">

        <p>

          <span t-field="line.product_uom_qty"/>

        </p>

        <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_quantity'][2]/span[3]" meta-t-if="line.product_uom_id != line.product_id.uom_id" meta-class="text-center"/>

      </td>

    </xpath>

    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_discount']" meta-name="td_discount" meta-t-if="display_discount" meta-class="text-center">

      <td>

        <p>

          <span t-field="line.price_reduce_taxexcl"/>

        </p>

      </td>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_priceunit']/span[@t-field='line.price_unit']" meta-t-field="line.price_unit"/>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_priceunit']" meta-name="td_priceunit" meta-class="text-end ">

      <p><span class="text-end" t-field="line.price_unit"/></p>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_taxes']/span" meta-t-out="taxes"/>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_taxes']" meta-name="td_taxes" meta-t-attf-class="text-center {{ 'text-nowrap' if len(taxes) &lt; 10 else '' }}">

      <p t-out="taxes">Tax 15%</p>

      <p class="text-end"><span t-field="line.price_tax"/></p>

    </xpath>

  </data>

  <data>

    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_section_line']" meta-name="td_section_line" meta-colspan="99">

      <attribute name="colspan">100</attribute>

    </xpath>

  </data>

  <data>

    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_note_line']" meta-name="td_note_line" meta-colspan="99">

      <attribute name="colspan">100</attribute>

    </xpath>

  </data>

  <data>

    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_section_subtotal']" meta-name="td_section_subtotal" meta-colspan="99">

      <attribute name="colspan">100</attribute>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[5]" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[9]/div" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[10]/div" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[11]" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

</data>

0
Avatar
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

Hi,


* Use text-center, text-end, or utility classes like col-x (width) to align content.

        <th class="text-center col-2">Price Excl</th>


* To render numeric expressions cleanly and consistently, replace t-field or t-out with:

           <span t-esc="line.price_unit * (1 - (line.discount or 0.0) / 100.0)" />


* Define Column Widths and Avoid Replacing Incorrect Nodes.

- Rather than replacing generic tags, target the correct sale order report template:

              - Inherit from sale.report_saleorder_document (not its copy).

              - Modify existing <th name="th_quantity">, <td name="td_priceunit">, etc.


Try the following code.


<odoo>

  <template id="report_saleorder_document_custom" inherit_id="sale.report_saleorder_document">


    <!-- Modify Table Headers -->

    <xpath expr="//thead/tr/th[@name='th_discount']" position="after">

      <th class="text-end" name="th_price_excl">Price Excl</th>

      <th class="text-end" name="th_tax">VAT</th>

    </xpath>


    <!-- Quantity Column -->

    <xpath expr="//th[@name='th_quantity']" position="attributes">

      <attribute name="class">text-end</attribute>

    </xpath>

    <xpath expr="//td[@name='td_quantity']" position="attributes">

      <attribute name="class">text-end</attribute>

    </xpath>


    <!-- Modify Table Data Rows: Add Price Excl and Tax -->

    <xpath expr="//td[@name='td_discount']" position="after">

      <td class="text-end" name="td_price_excl">

        <span t-esc="line.price_reduce_taxexcl"/>

      </td>

      <td class="text-end" name="td_tax">

        <span t-field="line.price_tax"/>

      </td>

    </xpath>


    <!-- Format Price Unit -->

    <xpath expr="//td[@name='td_priceunit']" position="replace">

      <td class="text-end" name="td_priceunit">

        <span t-esc="line.price_unit"/>

      </td>

    </xpath>


    <!-- Optional: Format subtotal for consistency -->

    <xpath expr="//td[@name='td_subtotal']" position="replace">

      <td class="text-end" name="td_subtotal">

        <span t-esc="line.price_total"/>

      </td>

    </xpath>


  </template>

</odoo>


* Ensure that the inherited template is correct.



Hope it helps.

1
Avatar
Ignorer
Jitesh Jeram
Auteur

Thank you so much. This helped with the spacing.

https://ibb.co/JY687qw

How can I
- format the "Unit Price" & "Vat" (not the percentage) values to all look like the "Price Excl" value
- Calculate the discount amount and show it (similar to the "VAT" coloumn)
- Change the "Qty" to integer

Avatar
Jitesh Jeram
Auteur Meilleure réponse

I also want to adjust the heading

https://ibb.co/5g7MRrBk

I want to move the red section to under the "Quotation" heading to the right of the customer details.

0
Avatar
Ignorer
Avatar
D Enterprise
Meilleure réponse

Hi,

Adds Price Excl and VAT columns after Discount

Ensures column counts between <thead> and <tbody> match

Formats all prices and numbers consistently using t-field

Aligns all numeric columns to the right with text-end

Avoids duplicated fields or broken nesting

please try this code 
<odoo>

    <data>


        <!-- HEADER: Add new columns after 'Discount' -->

        <xpath expr="//thead/tr/th[@name='th_discount']" position="after">

            <th class="text-end">Price Excl</th>

            <th class="text-end">VAT</th>

        </xpath>


        <!-- LINE ITEMS: Add matching <td> for new columns -->

        <xpath expr="//tbody//td[@name='td_discount']" position="after">

            <td class="text-end">

                <span t-field="line.price_reduce_taxexcl"/>

            </td>

            <td class="text-end">

                <span t-field="line.price_tax"/>

            </td>

        </xpath>


        <!-- QUANTITY COLUMN: Center align -->

        <xpath expr="//th[@name='th_quantity']" position="replace">

            <th name="th_quantity" class="text-center">Qty</th>

        </xpath>


        <xpath expr="//td[@name='td_quantity']" position="replace">

            <td name="td_quantity" class="text-center">

                <span t-field="line.product_uom_qty"/>

            </td>

        </xpath>


        <!-- PRICE UNIT COLUMN: Format properly -->

        <xpath expr="//td[@name='td_priceunit']" position="replace">

            <td name="td_priceunit" class="text-end">

                <span t-field="line.price_unit"/>

            </td>

        </xpath>


        <!-- SUBTOTAL / PRICE INCL COLUMN: Update header and value -->

        <xpath expr="//th[@name='th_subtotal']/span" position="replace"/>

        <xpath expr="//th[@name='th_subtotal']" position="inside">

            <span class="text-end">Price Incl</span>

        </xpath>


        <xpath expr="//td[@name='td_subtotal']" position="replace">

            <td name="td_subtotal" class="text-end">

                <span t-field="line.price_total"/>

            </td>

        </xpath>


        <!-- OPTIONAL: Ensure colspan is high enough for notes and sections -->

        <xpath expr="//td[@name='td_section_line']" position="attributes">

            <attribute name="colspan">100</attribute>

        </xpath>


        <xpath expr="//td[@name='td_note_line']" position="attributes">

            <attribute name="colspan">100</attribute>

        </xpath>


        <xpath expr="//td[@name='td_section_subtotal']" position="attributes">

            <attribute name="colspan">100</attribute>

        </xpath>


    </data>

</odoo>


i hope it is usefull

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Quote Builder With Custom Rental Report (Studio)
pdf
Avatar
0
oct. 25
523
Quote Builder With Custom Rental Report (Studio)
pdf
Avatar
0
oct. 25
4
How to edit the header of the quote template Résolu
pdf
Avatar
Avatar
Avatar
2
août 25
1311
How to Edit Out the Blank Space in the Quote/Order Confirmation PDFs? Résolu
pdf
Avatar
Avatar
Avatar
Avatar
3
août 25
2742
How to Disable Automatic PDF Download When Selecting "Invoice" in POS (Odoo Online)?
pdf
Avatar
1
juil. 25
1493
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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