Print and export PDF error

Hi Team,

I am very new to ERPNext and following this installation instruction here:

i am trying to print version and export PDF under Selling - Quotation, but got following error:

Date: {{ no such element: erpnext.selling.doctype.quotation.quotation.Quotation object[‘offer_date’] }}

Dear {{ no such element: erpnext.selling.doctype.quotation.quotation.Quotation object[‘applicant_name’] }},

We are pleased to appoint you in the services of MarketSimple on the terms and conditions detailed in this letter.

Your designation shall be {{ no such element: erpnext.selling.doctype.quotation.quotation.Quotation object[‘designation’] }}.

Please read the detailed terms as below. If you have any queries, feel free to get in touch with us. We look forward to your long and fruitful career association with our organisation. If you decide to join us, ‘Welcome to MarketSimple !’

Yours truly,

Authorized Signatory

Another error is exporting to PDF version:

Traceback (innermost last):
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/app.py", line 60, in application
    response = frappe.api.handle()
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/api.py", line 50, in handle
    return frappe.handler.handle()
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/__init__.py", line 805, in call
    return fn(*args, **newargs)
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/templates/pages/print.py", line 182, in download_pdf
    frappe.local.response.filecontent = get_pdf(html)
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 16, in get_pdf
    pdfkit.from_string(html, fname, options=options or {})
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/env/src/pdfkit/pdfkit/api.py", line 68, in from_string
    return r.to_pdf(output_path)
  File "/var/service/www/nginx/marketsimple.com/erpnext5/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py", line 143, in to_pdf
    raise IOError("wkhtmltopdf exited with non-zero code {0}. error:\n{1}".format(exit_code, stderr.decode("utf-8")))
 IOError: wkhtmltopdf exited with non-zero code -6. error:
The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --print-media-type, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display 

I aslo tried to reinstall wkhtmltopdf, but not works.

Please advice how to fix this problem.
Thank you.

@bzero Why you need ERPNext version 5?
You can install latest version of ERPNext v6.

Please follow this instruction to install ERPNext v6

You can also download ERPNext pre-installed Image from here.

1 Like

for the first error its not with PDF, you have to check the variables your using in jinja template…

in the first line i dont know what you used in full but you have to use {{doc.transaction_date}} instead of offer_date unless you added offer date as custom field because i cant see offer date in the form options
(http://domain.domain/desk#Form/Customize%20Form/)

for the second error:

you have to check wkhtmltopdf andn test if its working probably first:
$ ./wkhtmltopdf-amd64 http://www.google.com example.pdf

if there was no errors then you have to try bench update

1 Like

Thanks all for your advise.

@kolate_sambhaji: That’s good.
I am following your link to install ERPNext v6 on top of existing v5, same system.
Do you think is it good to do that way? Do i need to delete the v5 first?

@ramielian:
Sure, i will test it soon, cause i am install v6.

In this case, you can backup your site database and update v5 to latest v6.

Make sure you have backup.

1 Like

Hi all,

i’d like update the thread. After reinstalling following the official instruction, this solved my issue.

I just want to know how could i custom display the Customer’s address. Currently, it displays as multi rows for Address, City, State, Zipcode and Country ?

Thanks a lot.

this could be related to another element, so i would marked this ticket as solved :smile:
Thanks!

@bzero you should actually open new topic but this is the answer below:

you can use two ways:

  1. the easy way: adjust the address template in the ERP to your liking:
    http://domain.domain/desk#List/Address%20Template

  2. you can use linking method via Jinja template to ask for only some information or divide the information to cells…

1 Like