ERPNext Costumer ID from naming series are wrong print format

Hello everyone,

i have a issue in my print format template.

If i use this code:

{{ frappe.db.get_value(“Customer”, self.customer_name) }}

and implement them for sales invoice in print format to get the Customer ID i get the wrong customer ID. If i create a new sales invoice with a new customer i get the same customer ID.

Are the code right or which code should i use to get the right ID for every costumer at the print format template?

Thank you for your help.

Regards
Kevco97

image

Hi @kevco97,

Please apply it.

{{ frappe.db.get_value("Customer", doc.customer, 'name') }}

Then reload and check it.

Thank You!

Hello NCP,

thank your for reply.

If i use your code then i get no customer ID (“None”) see enclosed.

But in the sales invoice details i can see a customer ID.

Regards
Kevco97

image

sales invoice details
image

Use {{doc.customer}} and check it.

Hello NCP,

Thank you now it works for sales invoice.

But is this code valid for quotation & order print format template?

If i use the code i had the same issue like every quotation get the same customer ID.

Regards
kevco97

for use {{doc.party_name}}

AND

for use {{doc.customer}}

Thank You!

Hi NCP,

thank you for your help now everything works fine :sunglasses:

Have a nice day.

Regards
kevco97