跳至內容
選單
此問題已被標幟
3 回覆
14655 瀏覽次數

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?

相關帖文 回覆 瀏覽次數 活動
0
7月 22
2497
1
11月 22
11807
2
10月 23
12827
0
10月 17
4141
1
6月 25
5100