Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

need help with adding a bank address to a customer invoice

By
Artem
on 9/22/16, 4:50 AM 211 views

I want to add a bank address to a customer invoice. Other fields are ok, but the address is empty.

Any help is appreciate.

<template id="report_invoice_document_inherit" inherit_id="account.report_invoice_document">
    <xpath expr="//p[@t-if='o.fiscal_position_id.note']" position="after">
        <t t-foreach="o.company_id.bank_journal_ids" t-as="journal">
            <t t-set="bank_acc" t-value="journal.bank_account_id"/>
            <t t-if="journal.display_on_footer">
                <div style="witdth: 35%; border-bottom: 1px solid black;" name="bank_address">
                    <br/>Bank: <span t-esc="bank_acc.bank_name"/>
                    <br/>Currency: <span t-esc="bank_acc.currency_id.name"/>
                    <br/>Account number: <span t-esc="bank_acc.acc_number"/>
                    <br/><span t-esc="bank_acc.bank_name"/>
                    <address t-field="bank_acc.bank_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                    <br/><t t-if="bank_acc.bank_bic"><span t-esc="bank_acc.bank_bic"/></t>
                </div>
            </t>
        </t>
    </xpath>
</template>



what is the model of bank_id field ? if you do <t t-esc=''bank_acc.bank_id"/> ...

In which version ?

Jérémy Kersten (jke)
on 9/22/16, 5:10 AM

bank_acc - res.partner.bank and bank_acc.bank_id - res.bank

I can see it it invoice if do <span t-esc="bank_acc.bank_id">

Odoo 9.0

Artem
on 9/22/16, 5:29 AM

What's the output of : <t-esc="bank_acc.bank_id.sudo().with_context(show_address=True).name_get()[0][1]"/>

note sure that widget contact work for other object than res_partner out of the box...

Jérémy Kersten (jke)
on 9/22/16, 5:38 AM
0
Artem
On 9/22/16, 11:08 AM

Widget contact does not work because of res.bank model has not got fields: mobile, website, country_id (has got 'country') and I do not understand what is the first address that is checked in /base/ir/ir_qweb.xml templette:  <div t-if="address and 'address' in fields">.

I think it's good idea to make all models where address is used compatible with the contact widget.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 9/22/16, 4:50 AM
Seen: 211 times
Last updated: 9/22/16, 11:31 AM