Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
14619 Vizualizări

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.

Imagine profil
Abandonează
Autor

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

Cel mai bun răspuns

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează

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 Răspunsuri Vizualizări Activitate
0
iul. 22
2460
1
nov. 22
11785
2
oct. 23
12767
0
oct. 17
4119
1
iun. 25
5076