Closed ljain112 closed 3 days ago
The error was due to the same name web template already existing.
This is what we recommend: https://docs.indiacompliance.app/docs/developer-guide/e_invoice_qr
So if it's a duplicate, we should handle this.
Fieldname suggested was qr_text
Implemented was e_invoice_qr_text
.
Corrections Possible:
I think we should go with second option?
:tada: This issue has been resolved in version 15.9.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Traceback (most recent call last): File "apps/frappe/frappe/utils/jinja.py", line 97, in render_template return get_jenv().from_string(template).render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "env/lib/python3.11/site-packages/jinja2/environment.py", line 939, in handle_exception raise rewrite_traceback_stack(source=source) File "", line 1, in top-level template code File "env/lib/python3.11/site-packages/jinja2/sandbox.py", line 394, in call return context.call(obj, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/india_compliance/india_compliance/gst_india/utils/jinja.py", line 97, in get_qr_code return pyqrcode.create(qr_text).png_as_base64_str(scale=scale, quiet_zone=1) ^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 111, in create return QRCode(content, error, version, mode, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 137, in init guessed_content_type, encoding = self._detect_content_type(content, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 307, in _detect_content_type c = content.encode('shiftjis') ^^^^^^^^^^^^^^ jinja2.exceptions.UndefinedError: 'qr_text' is undefined
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "apps/frappe/frappe/utils/pdf.py", line 49, in pdf_body_html return template.render(args, filters={"len": len}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "env/lib/python3.11/site-packages/jinja2/environment.py", line 939, in handle_exception raise rewrite_traceback_stack(source=source) File "apps/frappe/frappe/templates/print_formats/standard.html", line 19, in top-level template code {{ render_field(df, doc, no_of_cols) }} ^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/jinja2/sandbox.py", line 394, in call return context.call(obj, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/jinja2/runtime.py", line 782, in _invoke rv = self._func(arguments) ^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/templates/print_formats/standard_macros.html", line 5, in template
File "env/lib/python3.11/site-packages/jinja2/sandbox.py", line 394, in call return context.call(obj, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/utils/jinja.py", line 97, in render_template return get_jenv().from_string(template).render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "env/lib/python3.11/site-packages/jinja2/environment.py", line 939, in handle_exception raise rewrite_traceback_stack(source=source) File "", line 13, in top-level template code File "env/lib/python3.11/site-packages/jinja2/sandbox.py", line 394, in call return context.call(obj, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/utils/jinja_globals.py", line 37, in web_block return web_blocks([options]) ^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/utils/jinja_globals.py", line 65, in web_blocks out = get_web_blocks_html(web_blocks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/website/doctype/web_page/web_page.py", line 250, in get_web_blocks_html "web_template_html": web_template.render(block.web_template_values), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/website/doctype/web_template/web_template.py", line 130, in render return frappe.render_template(template, values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/utils/jinja.py", line 99, in render_template throw( File "apps/frappe/frappe/init.py", line 645, in throw msgprint( File "apps/frappe/frappe/init.py", line 610, in msgprint _raise_exception() File "apps/frappe/frappe/init.py", line 561, in _raise_exception raise exc frappe.exceptions.ValidationError:
args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/india_compliance/india_compliance/gst_india/utils/jinja.py", line 97, in get_qr_code return pyqrcode.create(qr_text).png_as_base64_str(scale=scale, quiet_zone=1) ^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 111, in create return QRCode(content, error, version, mode, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 137, in init guessed_content_type, encoding = self._detect_content_type(content, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 307, in _detect_content_type c = content.encode('shiftjis') ^^^^^^^^^^^^^^ jinja2.exceptions.UndefinedError: 'qr_text' is undefinedDuring handling of the above exception, another exception occurred:
Traceback (most recent call last): File "apps/frappe/frappe/app.py", line 114, in application response = frappe.api.handle(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/api/init.py", line 49, in handle data = endpoint(arguments) ^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call return frappe.handler.handle() ^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/handler.py", line 49, in handle data = execute_cmd(cmd) ^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/handler.py", line 85, in execute_cmd return frappe.call(method, frappe.form_dict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/init.py", line 1768, in call return fn(*args, newargs) ^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/www/printview.py", line 311, in get_html_and_style html = get_rendered_template( ^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/www/printview.py", line 225, in get_rendered_template html = frappe.get_attr(hook_func[-1])(jenv=jenv, template=template, print_format=print_format, args=args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/frappe/frappe/utils/pdf.py", line 52, in pdf_body_html frappe.throw( File "apps/frappe/frappe/init.py", line 645, in throw msgprint( File "apps/frappe/frappe/init.py", line 610, in msgprint _raise_exception() File "apps/frappe/frappe/init.py", line 561, in _raise_exception raise exc frappe.exceptions.PrintFormatError: Error in print format on line 19: request.js:473:14
args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "apps/india_compliance/india_compliance/gst_india/utils/jinja.py", line 97, in get_qr_code return pyqrcode.create(qr_text).png_as_base64_str(scale=scale, quiet_zone=1) ^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 111, in create return QRCode(content, error, version, mode, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 137, in init guessed_content_type, encoding = self._detect_content_type(content, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "env/lib/python3.11/site-packages/pyqrcode/init.py", line 307, in _detect_content_type c = content.encode('shiftjis') ^^^^^^^^^^^^^^ jinja2.exceptions.UndefinedError: 'qr_text' is undefinedFrappe Support Issue:https://support.frappe.io/app/hd-ticket/17804