Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 25
581
0
sty 25
1179
0
gru 24
1089
1
maj 25
1040
1
mar 25
1336