Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4979 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhấ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>

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 24
2499
5
thg 8 19
47014
4
thg 6 18
20650
0
thg 6 18
3707
2
thg 5 16
17705