跳至内容
菜单
此问题已终结
3 回复
3151 查看

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.

形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
0
5月 15
2880
2
6月 25
1468
4
5月 24
5719
1
5月 23
3584
4
8月 22
7677