Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached Print Format Coming in unrelated document. #44144

Open
RAhmed-Dev opened this issue Nov 14, 2024 · 0 comments
Open

Cached Print Format Coming in unrelated document. #44144

RAhmed-Dev opened this issue Nov 14, 2024 · 0 comments
Labels

Comments

@RAhmed-Dev
Copy link

Information about bug

Steps to Reproduce:

  1. Open Sales Invoice > Click on Print > Select a custom Print format.
  2. while remaining on the same tab > go to journal entry or any other document > Click on Print, I am getting the Following error.

image

image

Module

other

Version

image

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

request.js:473 
 Traceback (most recent call last):
  File "apps/frappe/frappe/utils/pdf.py", line 44, in pdf_body_html
    return template.render(args, filters={"len": len})
  File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 410, in top-level template code
  File "env/lib/python3.10/site-packages/jinja2/sandbox.py", line 387, in call
    return __self.format_string(fmt, args, kwargs, __obj)
  File "env/lib/python3.10/site-packages/jinja2/sandbox.py", line 374, in format_string
    rv = formatter.vformat(s, args, kwargs)
  File "/usr/lib/python3.10/string.py", line 165, in vformat
    result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
  File "/usr/lib/python3.10/string.py", line 218, in _vformat
    result.append(self.format_field(obj, format_spec))
  File "/usr/lib/python3.10/string.py", line 235, in format_field
    return format(value, format_spec)
TypeError: unsupported format string passed to DebugUndefined.__format__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, 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 1682, 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 300, in get_html_and_style
    html = get_rendered_template(
  File "apps/frappe/frappe/www/printview.py", line 212, in get_rendered_template
    html = frappe.get_attr(hook_func[-1])(
  File "apps/frappe/frappe/utils/pdf.py", line 47, in pdf_body_html
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 578, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 550, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 501, in _raise_exception
    raise exc
frappe.exceptions.PrintFormatError: Error in print format on line 410: unsupported format string passed to DebugUndefined.__format__
@RAhmed-Dev RAhmed-Dev added the bug label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant