Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
configurationfunction
1 Respondre
875 Vistes
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
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
¿Cómo puedo hablar con una persona de Delta?
configuration function
Avatar
0
de nov. 25
14
Product Variant on Website Only
configuration function
Avatar
Avatar
1
d’ag. 25
874
Event Ticket
configuration function
Avatar
0
de gen. 25
1543
Image Variants on Mobile
configuration function
Avatar
0
de des. 24
1515
Section with a customer number Solved
configuration system function
Avatar
Avatar
2
d’oct. 25
743
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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