Skip to Content
Menu
This question has been flagged
3 Replies
13090 Views

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.

Avatar
Discard
Author

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

Best Answer

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.

Avatar
Discard
Best Answer

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

Avatar
Discard
Author Best Answer

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

Avatar
Discard

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 Replies Views Activity
0
Jul 22
1418
1
Nov 22
10565
2
Oct 23
11014
0
Oct 17
3349
3
Jul 20
10015