mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
fix: Shop by category fixes (#34688)
* fix: Shop by category fixes * chore: Update tests
This commit is contained in:
@@ -53,6 +53,7 @@ def get_tabs(categories):
|
||||
|
||||
def get_category_records(categories: list):
|
||||
categorical_data = {}
|
||||
website_item_meta = frappe.get_meta("Website Item", cached=True)
|
||||
|
||||
for c in categories:
|
||||
if c == "item_group":
|
||||
@@ -64,7 +65,16 @@ def get_category_records(categories: list):
|
||||
|
||||
continue
|
||||
|
||||
doctype = frappe.unscrub(c)
|
||||
field_type = website_item_meta.get_field(c).fieldtype
|
||||
|
||||
if field_type == "Table MultiSelect":
|
||||
child_doc = website_item_meta.get_field(c).options
|
||||
for field in frappe.get_meta(child_doc, cached=True).fields:
|
||||
if field.fieldtype == "Link" and field.reqd:
|
||||
doctype = field.options
|
||||
else:
|
||||
doctype = website_item_meta.get_field(c).options
|
||||
|
||||
fields = ["name"]
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user