Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
3435 Visualizzazioni

In odoo 15 I have created a PDF report for invoices using a custom layout. The address of the customer, apparently not influenced by the custom template, is specified at the top left of the first page of the PDF. The content comes from the record that was created via "Customer" and selected via the field "partner_id". After the selection, the street and postal code as well as city are loaded in the edit view of an invoice and thus transferred to the PDF document. 

How can I extend or overwrite the address field in my custom report layout to create an own address field that comes from the customer data? I have created an additional field there via a module that can store an address addition. I would like to be able to include this field in the address field of the PDF report.

Avatar
Abbandona
Risposta migliore

Hi,

You can create a div using the class 'header' to display those details on the header of your template and also the 'footer' class to add datas on the Template.To get a better understanding,you could refer any default templates of odoo like web.external_layout,web.external_layout_standard..etc.In the default templates,the address details are specified from the company field.You can specify the details on your template based on the customer.

Regards

Avatar
Abbandona
Autore Risposta migliore

Thank you!
So that means I have to create a div in my custom layout template with the class "header" and reference the fields in there? Where do I find out what the field names I have to specify here are called, i.e. under what name/id I can retrieve them? My custom field in Customer is called "address_suffix" in the object "res.partner"

Avatar
Abbandona
Risposta migliore

Hi Michael 

You can do that by using Xpath and add this details in header tag 

I hope that help you

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mag 15
3057
2
giu 25
2229
4
mag 24
6204
1
mag 23
3987
4
ago 22
8037