I'm working with Odoo 14 eCommerce module for Shop and I'm customising email template (Sales: Order Confirmation).
I would like to show bank informations which are already inserted on Accounting / Bank Accounts section of the company contact informations such as; bank name, account holder name, account number etc.
I'm calling those values like this in the template:
${object.company_id.bank_ids.acc_holder_name}
${object.company_id.bank_ids.bank_name}
${object.company_id.bank_ids.acc_number}
When there is only one bank account defined, I get the right values without problem but as soon as I add a second bank account, I get this error below:
Failed to render template : Expected singleton: res.partner.bank(2, 3)
I understand that there are ids of bank accounts but I don't know what is the right way to indicate the id of the bank account which I want to get the value. Any idea?
Use t-foreach if it is a template and if you want to display each account
Hi Bojan,
I think either you didn't understand me or I couldn't explain myself well. So, this is an email template that i want get bank account details and show when this email send out to a user.
When there is only one bank account defined for the account holder of the company, there is no problem, I can get the values. For example for bank account number:
${object.company_id.bank_ids.acc_number}
If there are more than one account, I got this error:
Failed to render template : Expected singleton: res.partner.bank(2, 3)
What I found is that I can get the first (from order) bank account values with the code below.
${object.company_id.bank_ids[0].acc_number}
But, I want to get the value base on their ids. This is what I'm looking for.