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

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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"

Imagine profil
Abandonează
Cel mai bun răspuns

Hi Michael 

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

I hope that help you

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mai 15
2952
2
iun. 25
1944
4
mai 24
6050
1
mai 23
3831
4
aug. 22
7841