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

version:  Odoo 9

How can I add a custom field into the PDF printable of Sales Order in Odoo?

I created Scheduled delivery date in Database Structure > Model using Developer mode; like this,

Field Name = x_scheduled_date

Field Label = Scheduled Delivery

Field Type = text


It successfully displayed in UI but not in printable version PDF.

How can I simply add this into the PDF please? Next to 'Payment Term' 

Please help me with the exact steps and models needed. 

Thank you very much.

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

*Moreover, I constantly receive error when trying to edit... report_saleorder_document > Qweb reports in Technical > Reports. One error is: QWebException: 'NoneType' object has no attribute '_fields'

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

Hi Pia,

1- After activating the developer mode. Go to settings>Reports

2- Search for template name sale.report_saleorder > Click on Search associated QWeb views

3- Chose sale.report_saleorder_document.

4- Add your field to the report Architecture (here you must do some HTML coding)

If you have trouble to handle this, search for

[...]
<div t-if="doc.date_order" class="col-xs-3">
    <strong t-if="doc.state not in ['draft','sent']">Date Ordered:</strong>
    <strong t-if="doc.state in ['draft','sent']">Quotation Date:</strong>
    <p t-field="doc.date_order"/>
</div>
[...]

past this lines after

<div t-if="doc.user_id.name" class="col-xs-3">                    
    <strong>Scheduled Delivery:</strong>
    <p t-field="doc.x_scheduled_date"/>
</div>

Best regards.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

how can i add customized " section" field to product sales order line in odoo 10 

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

It work!  You are heaven sent! Thank you very much for your help :) 

อวตาร
ละทิ้ง

Happy to help :)

Hi Pia,

I am trying to do the same thing but for sales people who are not users. What I have done is added them as employees and successfully managed to create a filed named Sales Rep in the sales order view.

Field Name x_sales_reps

Field Label Sales Rep

Model Partner

Field Type many2one

Object Relation hr.employee

This gives a drop down of all employees. How can I display the selected employee (sales rep) on sales order report?

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ค. 22
2500
Show custom field on invoice pdf แก้ไขแล้ว
1
พ.ย. 22
11808
2
ต.ค. 23
12831
0
ต.ค. 17
4144
How to find the field type? แก้ไขแล้ว
1
มิ.ย. 25
5102