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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
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
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"
Hi Michael
You can do that by using Xpath and add this details in header tag
I hope that help you
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
May 15
|
2162 | ||
|
4
May 24
|
4432 | ||
|
1
May 23
|
2199 | ||
|
4
Aug 22
|
6624 | ||
|
0
Jul 17
|
1901 |