Merge pull request #26134 from marination/product-weightage
fix: Sort website products by weightage mentioned in Item master
This commit is contained in:
commit
9f15ebe711
@ -61,7 +61,8 @@ class ProductQuery:
|
|||||||
],
|
],
|
||||||
or_filters=self.or_filters,
|
or_filters=self.or_filters,
|
||||||
start=start,
|
start=start,
|
||||||
limit=self.page_length
|
limit=self.page_length,
|
||||||
|
order_by="weightage desc"
|
||||||
)
|
)
|
||||||
|
|
||||||
items_dict = {item.name: item for item in items}
|
items_dict = {item.name: item for item in items}
|
||||||
@ -71,7 +72,15 @@ class ProductQuery:
|
|||||||
|
|
||||||
result = [items_dict.get(item) for item in list(set.intersection(*all_items))]
|
result = [items_dict.get(item) for item in list(set.intersection(*all_items))]
|
||||||
else:
|
else:
|
||||||
result = frappe.get_all("Item", fields=self.fields, filters=self.filters, or_filters=self.or_filters, start=start, limit=self.page_length)
|
result = frappe.get_all(
|
||||||
|
"Item",
|
||||||
|
fields=self.fields,
|
||||||
|
filters=self.filters,
|
||||||
|
or_filters=self.or_filters,
|
||||||
|
start=start,
|
||||||
|
limit=self.page_length,
|
||||||
|
order_by="weightage desc"
|
||||||
|
)
|
||||||
|
|
||||||
for item in result:
|
for item in result:
|
||||||
product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True).get('product_info')
|
product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True).get('product_info')
|
||||||
|
Loading…
Reference in New Issue
Block a user