jinja2.exceptions.UndefinedError: 'doc' is undefined

i submit the request for quotation form. ok?
by that, one email is being send to one user who is having a supplier permission. ok?
in this mail there is a button.
user supplier is clicking on this button and being redirected to the portal. supplier will log in by his credentials and see the list of forms like request for quotation and other forms. ok? have a look into the screenshot

supplier is opening request for quotation and opening the document. have a look into the second screenshot.

user will fill the entries and click on submit and user is being redirected to supplier quotation and giving this error. 3rd screenshot.
and this is the fill context of full error

and this is the full context of the issue

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.10/site-packages/jinja2/environment.py”, line 1304, in render
self.environment.handle_exception()
File “env/lib/python3.10/site-packages/jinja2/environment.py”, line 939, in handle_exception
raise rewrite_traceback_stack(source=source)
File “”, line 2, in top-level template code
File “apps/frappe/frappe/templates/web.html”, line 1, in top-level template code
{% extends base_template_path %}
File “apps/frappe/frappe/templates/base.html”, line 13, in top-level template code
{% block title %}{{ title | striptags }}{% endblock %}
File “”, line 8, in block ‘title’
File “env/lib/python3.10/site-packages/jinja2/sandbox.py”, line 327, in getattr
value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: ‘doc’ is undefined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/website/serve.py”, line 20, in get_response
response = renderer_instance.render()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 84, in render
html = self.get_html()
File “apps/frappe/frappe/website/utils.py”, line 529, in cache_html_decorator
html = func(*args, **kwargs)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 101, in get_html
html = self.render_template()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 236, in render_template
html = frappe.render_template(self.source, self.context, safe_render=safe_render)
File “apps/frappe/frappe/utils/jinja.py”, line 99, in render_template
throw(
File “apps/frappe/frappe/init.py”, line 652, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 617, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 568, in _raise_exception
raise exc
frappe.exceptions.ValidationError: {% extends “templates/web.html” %}
{% from “serikandi_customizations/templates/includes/order/order_macros.html” import item_name_and_description %}

{% block breadcrumbs %}
{% include “templates/includes/breadcrumbs.html” %}
{% endblock %}

{% block title %}{{ doc.name }}{% endblock %}

{% block header %}
{{ doc.name }}
{% endblock %}

{% block header_actions %}

		{{ _('Actions') }}
		
	
	
		{% if doc.doctype == 'Purchase Order' and show_make_pi_button %}
			{{ _("Make Purchase Invoice") }}
		{% endif %}
		
			{{ _("Print") }}

{% endblock %}

{% block page_content %}

			{% if doc.doctype == "Quotation" and not doc.docstatus %}
				{{ _("Pending") }}
			{% else %}
				{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }}
			{% endif %}
		
	
	
		{{ frappe.utils.format_date(doc.transaction_date, 'medium') }}
		{% if doc.valid_till %}
		
		{{ _("Valid Till") }}: {{ frappe.utils.format_date(doc.valid_till, 'medium') }}
		
		{% endif %}
	



	{%- set party_name = doc.supplier_name if doc.doctype in ['Supplier Quotation', 'Purchase Invoice', 'Purchase Order'] else doc.customer_name %}
	{{ party_name }}

	{% if doc.contact_display and doc.contact_display != party_name %}
		
		{{ doc.contact_display }}
	{% endif %}


{% if doc._header %}
	{{ doc._header }}
{% endif %}


	
	
		
			
				{{ _("Item") }}
			
			
				{{ _("Quantity") }}
			
			
				{{ _("Amount") }}
			
		
		
		{% for d in doc.items %}
		
			
				{{ d.item_name}}
			
			
				{{ d.qty }}
				{% if d.delivered_qty is defined and d.delivered_qty != None %}
					{{ _("Delivered") }} {{ d.delivered_qty }}
				{% endif %}
			
			
				{{ d.get_formatted("amount")	 }}
				{{ _("Rate:") }} {{ d.get_formatted("rate") }}
			
		
		{% endfor %}
		
	
	
	
		
			{% include "erpnext/templates/includes/order/order_taxes.html" %}
		
	


{% if enabled_checkout and ((doc.doctype=="Sales Order" and doc.per_billed  0)) %}
	
		
			
				
					Payment
				
			
		
		
			
				
					
						{% if available_loyalty_points %}
						
							Enter Loyalty Points
							
								
									
								
								 Available Points: {{ available_loyalty_points }} 
							
						
						{% endif %}
					

					
						
						
							
								
									{{ _("Pay") }} {{ doc.get_formatted("grand_total") }}
								
							
						
					

				

			
		
	
{% endif %}

{% if attachments %}
	
		
			
				{{ _("Attachments") }}
			
		
		
			
				{% for attachment in attachments %}
				
					 {{ attachment.file_name }} 
				
				{% endfor %}
			
		
	
{% endif %}


{% if doc.terms %}
	
		{{ doc.terms }}
	
{% endif %}

{% endblock %}

{% block script %}
{% include “templates/pages/order.js” %}

	window.doc_info = {
		customer: '{{doc.customer}}',
		doctype: '{{ doc.doctype }}',
		doctype_name: '{{ doc.name }}',
		grand_total: '{{ doc.grand_total }}',
		currency: '{{ doc.currency }}'
	}

{% endblock %}
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.10/site-packages/jinja2/environment.py”, line 1304, in render
self.environment.handle_exception()
File “env/lib/python3.10/site-packages/jinja2/environment.py”, line 939, in handle_exception
raise rewrite_traceback_stack(source=source)
File “”, line 2, in top-level template code
File “apps/frappe/frappe/templates/web.html”, line 1, in top-level template code
{% extends base_template_path %}
File “apps/frappe/frappe/templates/base.html”, line 13, in top-level template code
{% block title %}{{ title | striptags }}{% endblock %}
File “”, line 8, in block ‘title’
File “env/lib/python3.10/site-packages/jinja2/sandbox.py”, line 327, in getattr
value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: ‘doc’ is undefined