Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

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

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

Customize Report problem

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
pdf
3 Respostas
1633 Visualizações
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
Cancelar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Melhor resposta

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
Cancelar
Jitesh Jeram
Autor

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
Autor Melhor resposta

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
Cancelar
Avatar
D Enterprise
Melhor resposta

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
Cancelar
Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
Quote Builder With Custom Rental Report (Studio)
pdf
Avatar
0
out. 25
525
Quote Builder With Custom Rental Report (Studio)
pdf
Avatar
0
out. 25
4
How to edit the header of the quote template Resolvido
pdf
Avatar
Avatar
Avatar
2
ago. 25
1314
How to Edit Out the Blank Space in the Quote/Order Confirmation PDFs? Resolvido
pdf
Avatar
Avatar
Avatar
Avatar
3
ago. 25
2750
How to Disable Automatic PDF Download When Selecting "Invoice" in POS (Odoo Online)?
pdf
Avatar
1
jul. 25
1493
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة 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 é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

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