Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

printing the "Contact Reference" in the Sales Order Invoice Report PDF?

By
Philipp Becker
on 11/11/15, 8:42 AM 811 views

Sales -> Customers -> Sales & Purchases Tab -> Contact Reference

I want to print this information in the Sales Order Invoice Report PDF, is this possible?

 

Which report ? SO, ...

Ahmed M.Elmubarak
on 11/12/15, 1:54 AM

Sales Order , Invoice

Philipp Becker
on 11/12/15, 3:31 AM
2

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 11/12/15, 7:17 AM

Hi,

You may try like this in your module.

Create a file custom_saleorder.xml under views folder in your module. Also mention it in __openerp__.py file.

Then add following code in the file, to have customer reference in sale order:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_saleorder_inherited" inherit_id="sale.report_saleorder_document">

<xpath expr="//t/div/div[3]/div[1]" position="after">
<div t-if="o.partner_id.ref" class="col-xs-3">
<strong>Customer Reference:</strong>
<p t-field="o.partner_id.ref"/>
</div>
</xpath>

</template>
</data>
</openerp>

Restart the server and upgrade your module. Then try.

Similarly you can override the invoice report by inheriting the corresponding invoice template.

For eg: create a file custom_invoice_report.xml file under views folder in your module. And add the following code:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_invoice_document_inherited" inherit_id="account.report_invoice_document">

<xpath expr="/t/div/div[2]/div[5]" position="after">
<div t-if="o.partner_id.ref" class="col-xs-3">
<strong>Customer Reference:</strong>
<p t-field="o.partner_id.ref"/>
</div>
</xpath>

</template>
</data>
</openerp>

Also don't forget to mention sale, account as depends in your __openerp__.py file.

worked for me, thanks!
Philipp Becker
on 11/12/15, 8:57 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/11/15, 8:42 AM
Seen: 811 times
Last updated: 11/12/15, 8:56 AM