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

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

*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'

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

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

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?

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 22
2494
1
thg 11 22
11804
2
thg 10 23
12812
0
thg 10 17
4135
1
thg 6 25
5085