Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2217 มุมมอง

Hello,


I want to add the customer name to my printed pdf reports name.


Now, pdf reports default name is: Order - S00189
I want it to become: Order - S00189 - FirstName LastName


I know it is done from Setting --> Technical --> Reports --> The Report I want, and then modifying the Printed Report Name field code. But I do not know how to properly modify it.

The field currently contains the following code:

(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name)

Thanks for the help



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Unless you have your own custom fields for First and Last Name, you would normally use Display Name which would automatically be set to:

  • the Company Name
  • the Individuals Name
  • the Company Name followed by the Individuals Name

Examples:

  • ACME, James Smith
  • ACME
  • James Smith


To get something like this:

     

Try this:

(object.state in ('draft', 'sent')  and 
'Quotation - %s - %s' % (object.name, object.partner_id.display_name)
)
 or
'Order - %s - %s' % (object.name, object.partner_id.display_name)


Note: If the comma in the filename causes problems (it may with older software not written by our awesome Odoo developers), you can switch to the name field instead to just show the Company or Individual Name instead of the combination.​

อวตาร
ละทิ้ง
ผู้เขียน

Thank you! It works perfectly!

Awesome!

คำตอบที่ดีที่สุด

Thanks, this works perfect!

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 21
2442
1
พ.ค. 18
3602
2
ม.ค. 17
6748
Reports not auto-saved to attachments แก้ไขแล้ว
3
มี.ค. 15
7471
9
ส.ค. 23
20473