콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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.

관련 게시물 답글 화면 활동
4
10월 22
5989
1
7월 25
4035
0
11월 21
1809
0
4월 21
3020
0
3월 24
1496