Skip to Content
Menu
This question has been flagged
4 Replies
3659 Views

How to add the contact details of a customer in a sales invoice Qweb Report.Right now it is only showing the Shipping address. Please help me out to add the companies Contact address in the invoice.
Thanks in advance.

Avatar
Discard

so you want to company address in the report ?

Yes Niyas,

Actually i want to add the companies mail contact details in Qweb report for sales Invoice , Right now i am able to see only the shipping address on PDF.
I tried a lot to add the contact details but no luck...!

Plz find the attachment its only contains the shiping address which is on the right hand side of the invoice (Cognizant, DLF), But what i want extra is the main branch address of cognizant which will be on just left hand side of the invoice.

kind request you to please help me out for the same.

Thanks in advance...!


Thanks & Regards,
Tushar Wagh
+91-9021097798


On Monday 03 July 2017 04:50 PM, Niyas Raphy wrote:

so you want to company address in the report ?

--
Niyas Raphy


Sent by Odoo S.A. using Odoo.


-- 
Thanks & Regards,
Tushar Wagh | Junior Analyst Python
tushar.wagh@sailotech.in | Contact: 91-902109 7798
SAILOTECH
Transform Forward,Faster|www.sailotech.com 
Author Best Answer

I tried the same in "report_invoice_document"

but getting below error

QWebException: 'account.invoice' object has no attribute 'contact_address'
Traceback (most recent call last):
  File "C:\Program Files (x86)\Odoo 10.0\server\odoo\addons\base\ir\ir_qweb\qweb.py", line 315, in _compiled_fn
  File "<template>", line 1, in template_account_report_invoice_document_2465
  File "<template>", line 3, in body_call_content_2464
AttributeError: 'account.invoice' object has no attribute 'contact_address'

Error to render compiling AST
AttributeError: 'account.invoice' object has no attribute 'contact_address'
Template: account.report_invoice_document
Path: /templates/t/t/div/div[11]/span[2]
Node: <span t-raw="o.contact_address.replace('\n\n', '\n').replace('\n', '&lt;br&gt;')"/>




Avatar
Discard
Best Answer

Hi,

To get the company details in the invoice print, you just have to re arrange the existing report template.

You can do it by editing the original file like this,

Call the report.external_layout inside the page , so that company details will be displayed in the invoice.

You can get the template from Account - > Views -> report_invoice.xml, template name is report_invoice_document.

Original template is like this,

<template id="report_invoice_document">
<t t-call="report.external_layout">
         <div class="page">
#template content
         </div>
</t>
</template>


This you have to change like this,

<template id="report_invoice_document">
<div
class="page">
<t
t-call="report.external_layout">
#template content
</t>
</div>

</template>

Then the report will be like this,


Thanks


Avatar
Discard