ERPNext Conference 2019* ERPNext.com Blog

Print issue {{ frappe.db.get_value("Customer", doc.customer, "tax_id") }}


#1

i using
TRN#: {{ frappe.db.get_value(“Customer”, doc.customer, “tax_id”) }}
and
Customer#:{{ frappe.db.get_value(“Customer”, doc.customer, “customer_code”) }}

They are displaying in erpnext like


But when i output pdf, these two fields display “None”

How to make the value can be displayed in pdf.

My system is:
ERPNext: v11.1.44 (master)
Frappe Framework: v11.1.39 (master)


#2

Try this …
edit the site_config.json, and add the static IP address of your local server.

eg.
“host_name”: “http://192.168.1.111
then do a bench restart


#3

thank you for your reply.
Now in my site_config.json
“host_name”: “https://erp.manchemical.com”,

so now if i change to static IP,like http://192.168.1.111

Is there any other problem happen?


#4

i did two trials:
“host_name”: “http://localhost”,
and
“host_name”: “http://192.168.1.111”,

the same problem, in erpnext, ok, but display “none” in pdf.


#5

You need to adjust the IP address to match your requirements - I just used 192.168.1.111 as an example


#6

i think i using http://localhost is the same function as static ip, right?
Now localhost is not working for solving this issue.


#7

If you have an entry in the /etc/hosts file that matches the IP of your machine, then it should also work, so like this (but change the xxx to match the actual IP)

127.0.0.1 localhost
192.168.1.xxx erp.manchemical.com


#8

now in my /etc/hosts:

127.0.1.1 manchemical.com manchemical
127.0.0.1 localhost

So i need to add 192.168.1.xxx erp.manchemical.com, or change
127.0.1.1 manchemical.com manchemical?


#9

Now I add 167.xx.68.6 erp.manchemical.com:
So it looks like:

127.0.1.1 manchemical.com manchemical
127.0.0.1 localhost
167.xx.68.6 erp.manchemical.com

167.xx.68.6 is my server ip.


#10

but still display “none” in pdf.


#11

just now even i change
“host_name”: “https://167.xx.68.6” in site_config.json
and bench restart.

Still “none” in pdf.

sorry, i am fresh in erpnext, and appreciated to help me, please help me to solve this issue!


#12

Did you create a report builder version, or is this a Jinja2 output?


#13

i dont know, i installed original erpnext.