Skip to Content
Menu
This question has been flagged
4 Replies
24437 Views

I want to include the details of the bank account selected from the Invoice>>Other info(tab)>>Bank Account onto a printed invoice. I want to know the variable name of the bank account choosen so that i can do something like this on the invoice design:

[[ (o.partner_bank_id and o.partner_bank_id.note and format(o.partner_bank_id and o.partner_bank_id.note)) or removeParentNode('para') ]]

In summary i dont know the variable name to reference the bank account choosen.

Avatar
Discard

@sepuuya, I'm also interested in this. Please post back if you find a solution. I will do the same.

@guillaume, Thanks for your help! Do you know how I would call this on in a QWeb format invoice? I've tried the following: Bank Name: Bank BIC/SWIFT: however i'm getting the following traceback: QWebException: ""'sale.order' object has no attribute 'partner_bank_id'" while evaluating 'o.partner_bank_id'" while evaluating "translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')" I'm working in Odoo 8.0 (latest pull from github today).

You have this error because partner_bank_id only exist in account.invoice not in sale.order !

@Guillaume, Thanks for your help, I will try to add partner_bank_id to the saleorder document.

Best Answer

Hi

If you are using odoo 12

If the Bank Account (partner_bank_id) field get data in the Other info tab

then try this

        


               

Bank Details

                Bank Name :
               

                Account Number :
               

                SWIFT Code :
               
       



Avatar
Discard

My apologies Prajith - I was trying to add my own answer, but but I could not display code. Tried to edit yours to see what to do, didint save changes , just cancelled, but then your code disappeared. :( Sorry

Best Answer

See the video tutorial for Odoo 9, 10 and 11:

https://youtu.be/QJJd0XsK5-0

In Odoo 9.0 you can set the custom footer and insert the bank account details in there:

Settings/Companies/Report Configuration/Report Footer.

It can be also made from Accounting:

Accounting/Configuration/Accounting/Bank Accounts/Show in Invoices Footer


Avatar
Discard
Best Answer

Hi, 

If you are using Odoo 11, you can do it easily in Sale Orders:


<div class="row" t-if="doc.company_id.bank_ids">
<dl id="bank_account" t-foreach="doc.company_id.bank_ids" t-as="ba" class="dl-horizontal text-muted">
<dt>Bank:</dt>
<dd><span t-field="ba.bank_id.name"/></dd>
<dt>IBAN No.:</dt>
<dd><span t-field="ba.acc_number"/></dd>
<dt>Swift Code:</dt>
<dd><span t-field="ba.bank_id.bic"/></dd>
<dt>Country:</dt>
<dd><span t-field="ba.bank_id.country"/></dd>
</dl>
</div>

You can get all bank accounts from the company, the company is in this document the company_id; now well, in the res.partner model you can find the related bank accounts with the banks_id field; finally, you can iterate over them and getting all information that you need.

Avatar
Discard
Best Answer

hi, activate the developer mode! you will see the name of each field. if you write [[ o.partner_bank_id.field_name ]] it will print its value

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 24
218
5
Jan 24
4866
0
Oct 23
334
1
May 23
1206
1
Nov 22
752