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

Hi All, What is the correct way to include the document number in the footer for qweb reports. This would be used under sale orders, invoices and picking documents. Because in a sale order the field is called number (sale_order.name eg S0/12345) and in an invoice is is called a number (account_invoice.number eg VKB/171234 )

I tried this. But when i print qweb stops without warning when a field is not available in the current table. 

This is in my footer:

<span t-if='o.number' t-raw='o.number'/>

<span t-if='o.name' t-raw='o.name'/>

I check for the field but still the printing stops.

Best regards,

Maarten

อวตาร
ละทิ้ง
ผู้เขียน

Ok that works thanks a lot

คำตอบที่ดีที่สุด

Try checking to see if the field exists like this. This is how it is done in the external_layout view to check for company name.

<span t-if="'number' in o" t-raw='o.number'/>
<span t-if="'name' in o" t-raw='o.name'/>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello,

You can try using the following code

<div class="footer">

<span t-field="o.number"></span>
</div>

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

Thanks but no this will just stop during printing a sale order because this field does not exist in the sale_order table. I just checked, but I think I had done this before. That is why I tried the t-if.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 20
8807
3
มี.ค. 17
4450
1
ก.ค. 23
2424
7
ธ.ค. 23
22312
2
ม.ค. 25
9752