Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4993 มุมมอง

I am creating a report that is based on the sale.order model, I want to show whether or not the order has been paid which is in the account.invoice model. The link between them is docs.invoice_ids = account_invoice.number, is there a way to pull this information into my report?

<t t-if="docs.invoice_ids == account_invoice.number and account_invoice.state != 'Paid'">
    <b>****ORDER UNPAID****</b>
</t>
<t t-else="">
    ****ORDER PAID****
</t>

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I worked it out.. :)

<t t-if="docs.invoice_ids.state != 'paid'">
<b>****ORDER UNPAID****</b>
</t>
<t t-else="">
****ORDER <span style="text-transform: uppercase" t-esc="docs.invoice_ids.state"/>****
</t>

อวตาร
ละทิ้ง

It will work fine as long as there is only single invoice for the sale order. You will get error message if there is multiple invoice for the sale order

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ย. 24
2528
How do i create report in Qweb? แก้ไขแล้ว
5
ส.ค. 19
47029
4
มิ.ย. 18
20671
0
มิ.ย. 18
3718
What is QWeb (Odoo's reporting engine)? แก้ไขแล้ว
2
พ.ค. 16
17727