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

Odoo 17 – Display vendor bank account number on Purchase Order (form view + report) using Odoo Studio

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
configurationfunction
1 Responder
876 Visualizações
Avatar
Pedro

In Odoo 17, I need to display the vendor’s bank account number directly on the Purchase Order, both in the form view and in the PDF report, because the client requires advance payments against the PO and Accounting needs to see the account number as soon as the PO is generated. In vendor bills (account.move), Odoo already includes the fields bank_partner_id and partner_bank_id with the domain [('partner_id', '=', bank_partner_id)], which works perfectly to show only the vendor’s bank accounts. However, in Purchase Orders (purchase.order), these fields do not exist. I tried to replicate them in Odoo Studio by creating a Many2one field and copying the same domain/context, but when validating the view I get the error: “Field 'bank_partner_id' used in context ({'default_partner_id': bank_partner_id}) must be present in view but is missing”.

What I need is a way to show the vendor’s bank account on the Purchase Order. Ideally, either (A) automatically display it as a related field pointing to partner_id.bank_ids, or (B) allow the buyer to select from the vendor’s bank accounts, just like in vendor bills, and then have that value appear in the PO report. My questions are: what is the cleanest way to implement this? Should I extend purchase.order with a partner_bank_id Many2one field (like in account.move) and add the domain on partner_id, or create a bank_partner_id related to partner_id to replicate invoice logic? Also, is there a recommended hook or method to extend this properly in custom code instead of hacking it in Studio? Finally, from a business perspective, do you consider it bad practice to display vendor bank details on the PO? The client requires it because of advance payments, but normally Odoo only handles this at the invoice/payment stage.

How would you implement this in Odoo 17 so that it works smoothly in both the form and the report?

0
Avatar
Cancelar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Melhor resposta

Hi,


In Odoo 17, the cleanest way to show vendor bank details on Purchase Orders is to extend the purchase.order model with a new partner_bank_id field, similar to what exists in invoices. This field should be a Many2one to res.partner.bank with a domain restricting it to the selected vendor’s bank accounts. If needed, it can also auto-populate when a vendor is chosen, for example by defaulting to the first available bank account.


On the user interface side, this field can be added to the Purchase Order form view, and the chosen bank account can also be displayed in the Purchase Order PDF report by referencing o.partner_bank_id.acc_number. This mirrors the logic Odoo already uses in accounting and ensures that the right account details are available early in the process.


From a business perspective, while Odoo normally introduces bank details at the invoice or payment stage, adding them directly to Purchase Orders is not bad practice if the client requires advance payments. It provides clarity to Accounting and ensures payments are directed correctly. Overall, this customization is straightforward and robust, and it integrates smoothly with Odoo’s standard logic.


The cleanest way is to extend the model in Python, not in Studio. You only need one extra field on purchase.order:


from odoo import fields, models



class PurchaseOrder(models.Model):

    _inherit = "purchase.order"


    partner_bank_id = fields.Many2one(

        "res.partner.bank",

        string="Vendor Bank Account",

        domain="[('partner_id', '=', partner_id)]",

        help="Bank account of the vendor for advance payments",

    )



XML


<record id="view_purchase_order_form_inherit" model="ir.ui.view">

    <field name="name">purchase.order.form.inherit.bank</field>

    <field name="model">purchase.order</field>

    <field name="inherit_id" ref="purchase.purchase_order_form"/>

    <field name="arch" type="xml">

        <xpath expr="//sheet/notebook/page[@name='other_info']/group" position="inside">

            <field name="partner_bank_id"/>

        </xpath>

    </field>

</record>



-Add it to the PO report (QWeb). For example, in report_purchaseorder_document:


<xpath expr="//div[@class='page']" position="inside">

    <p>

        <strong>Vendor Bank Account:</strong>

        <span t-esc="o.partner_bank_id.acc_number"/>

    </p>

</xpath>



Hope it helps

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
¿Cómo puedo hablar con una persona de Delta?
configuration function
Avatar
0
nov. 25
14
Product Variant on Website Only
configuration function
Avatar
Avatar
1
ago. 25
874
Event Ticket
configuration function
Avatar
0
jan. 25
1543
Image Variants on Mobile
configuration function
Avatar
0
dez. 24
1515
Section with a customer number Resolvido
configuration system function
Avatar
Avatar
2
out. 25
743
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