Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

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

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
configurationfunction
1 Svar
877 Visninger
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
Kassér
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Bedste svar

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

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
¿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
aug. 25
874
Event Ticket
configuration function
Avatar
0
jan. 25
1543
Image Variants on Mobile
configuration function
Avatar
0
dec. 24
1515
Section with a customer number Løst
configuration system function
Avatar
Avatar
2
okt. 25
743
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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