V12 : Webpage Product Setting Error

Hi,

Encounter the following error on V12.
I have tested by adding a Paypal payment gateway. Later try to manage the product setting under webpage. It prompted the following error :

==================================================
Uncaught Server Exception

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 48, in render
data = render_page_by_language(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 152, in render_page_by_language
return render_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 188, in build_page
context = get_context(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = build_context(context)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 87, in build_context
ret = context.doc.get_context(context)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/item_group/item_group.py”, line 73, in get_context
“products_as_list”: cint(frappe.db.get_single_value(‘Products Settings’, ‘products_as_list’))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 558, in get_single_value
frappe.throw(_(‘Invalid field name: {0}’).format(frappe.bold(fieldname)), self.InvalidColumnName)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.database.database.Database.InvalidColumnName: Invalid field name: products_as_list

2 Likes

“/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/item_group/item_group.py”, line 73, in
go here and replace below function and bench restart
def get_context(self, context):
context.show_search=True
context.page_length = cint(frappe.db.get_single_value(‘Products Settings’, ‘products_per_page’)) or 6
context.search_link = ‘/product_search’

	start = int(frappe.form_dict.start or 0)
	if start < 0:
		start = 0
	context.update({
		"items": get_product_list_for_group(product_group = self.name, start=start,
			limit=context.page_length + 1, search=frappe.form_dict.get("search")),
		"parents": get_parent_item_groups(self.parent_item_group),
		"title": self.name
	})

	if self.slideshow:
		context.update(get_slideshow(self))

	return context
1 Like

Thanks , will try out :slight_smile:

you can update latest version it solved in it

I have updated. But seems still gat error.
Below is the version I have updated.

image

Uncaught Server Exception

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 48, in render
data = render_page_by_language(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 152, in render_page_by_language
return render_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 197, in build_page
html = frappe.get_template(context.template).render(context)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/jinja2/asyncsupport.py”, line 76, in render
return original_render(self, *args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/jinja2/_compat.py”, line 37, in reraise
raise value.with_traceback(tb)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/./templates/generators/item/item.html”, line 1, in top-level template code
{% extends “templates/web.html” %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 1, in top-level template code
{% extends base_template_path %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/base.html”, line 68, in top-level template code
{% block content %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 60, in block “content”
{{ main_content() }}
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/jinja2/runtime.py”, line 579, in _invoke
rv = self._func(*arguments)
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 15, in template
{% block page_container %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 30, in block “page_container”
{%- block page_content -%}{%- endblock -%}
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/./templates/generators/item/item.html”, line 15, in block “page_content”
{% include “templates/generators/item/item_details.html” %}
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/./templates/generators/item/item_details.html”, line 12, in top-level template code
{% if frappe.utils.strip_html(doc.web_long_description) %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 607, in strip_html
return _striptags_re.sub("", text)
TypeError: expected string or bytes-like object

I have updated the version to v12.0.3
But when I click on the product Item created in webpage, it still ended with error as previous.
I supposed already resolved ?

Please advice.
Thanks.

image

Uncaught Server Exception

Traceback (most recent call last):
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/website/render.py”, line 48, in render
data = render_page_by_language(path)
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/website/render.py”, line 152, in render_page_by_language
return render_page(path)
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/website/render.py”, line 197, in build_page
html = frappe.get_template(context.template).render(context)
File “/home/frappe-bigten/frappe-bench/env/lib/python3.6/site-packages/jinja2/asyncsupport.py”, line 76, in render
return original_render(self, *args, **kwargs)
File “/home/frappe-bigten/frappe-bench/env/lib/python3.6/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe-bigten/frappe-bench/env/lib/python3.6/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “/home/frappe-bigten/frappe-bench/env/lib/python3.6/site-packages/jinja2/_compat.py”, line 37, in reraise
raise value.with_traceback(tb)
File “/home/frappe-bigten/frappe-bench/apps/erpnext/erpnext/./templates/generators/item/item.html”, line 1, in top-level template code
{% extends “templates/web.html” %}
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 1, in top-level template code
{% extends base_template_path %}
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/./templates/base.html”, line 68, in top-level template code
{% block content %}
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 60, in block “content”
{{ main_content() }}
File “/home/frappe-bigten/frappe-bench/env/lib/python3.6/site-packages/jinja2/runtime.py”, line 579, in _invoke
rv = self._func(*arguments)
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 15, in template
{% block page_container %}
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 30, in block “page_container”
{%- block page_content -%}{%- endblock -%}
File “/home/frappe-bigten/frappe-bench/apps/erpnext/erpnext/./templates/generators/item/item.html”, line 15, in block “page_content”
{% include “templates/generators/item/item_details.html” %}
File “/home/frappe-bigten/frappe-bench/apps/erpnext/erpnext/./templates/generators/item/item_details.html”, line 12, in top-level template code
{% if frappe.utils.strip_html(doc.web_long_description) %}
File “/home/frappe-bigten/frappe-bench/apps/frappe/frappe/utils/data.py”, line 607, in strip_html
return _striptags_re.sub("", text)
TypeError: expected string or bytes-like object