Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
3291 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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"

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Michael 

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

I hope that help you

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
maj 15
2952
2
cze 25
1944
4
maj 24
6050
1
maj 23
3831
4
sie 22
7841