HI, we have a Print Format that runs perfectly on one Production system but fails with the following error on another Production system. Both are running the same versions of erpnext 6.27.9 & frappe 6.27.10.
Traceback (innermost last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 805, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/templates/pages/print.py”, line 142, in get_html_and_style
no_letterhead=no_letterhead, trigger_print=trigger_print),
File “/home/frappe/frappe-bench/apps/frappe/frappe/templates/pages/print.py”, line 121, in get_html
html = template.render(args, filters={“len”: len})
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 969, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File “”, line 76, in top-level template code
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/filters.py”, line 740, in do_list
return list(value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/filters.py”, line 931, in _select_or_reject
if modfunc(func(transfunc(item))):
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/filters.py”, line 925, in
name, item, args, kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 438, in call_test
raise TemplateRuntimeError(‘no test named %r’ % name)
TemplateRuntimeError: no test named ‘equalto’
From what we can tell, the error is linked to the following issue with differing versions of Jinja2:-
https://github.com/pallets/jinja/issues/329
The system that the Print Format fails on is running Jinja2 v2.7.3, and the successful one is running v2.8
For the “equalto” test to run, Jinja2 needs to be at least v2.7.8
Can anyone point me to the correct way to update Jinja2 the correct way?
Thanks