fix: user not able to view product (#21740)
This commit is contained in:
parent
7be71c88f2
commit
5cfbdf4bcb
@ -10,13 +10,15 @@ from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings
|
||||
from erpnext.utilities.product import get_price, get_qty_in_stock, get_non_stock_item_status
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_product_info_for_website(item_code):
|
||||
def get_product_info_for_website(item_code, skip_quotation_creation=False):
|
||||
"""get product price / stock info for website"""
|
||||
|
||||
cart_settings = get_shopping_cart_settings()
|
||||
if not cart_settings.enabled:
|
||||
return frappe._dict()
|
||||
|
||||
cart_quotation = frappe._dict()
|
||||
if not skip_quotation_creation:
|
||||
cart_quotation = _get_cart_quotation()
|
||||
|
||||
price = get_price(
|
||||
@ -51,7 +53,7 @@ def get_product_info_for_website(item_code):
|
||||
|
||||
def set_product_info_for_website(item):
|
||||
"""set product price uom for website"""
|
||||
product_info = get_product_info_for_website(item.item_code)
|
||||
product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True)
|
||||
|
||||
if product_info:
|
||||
item.update(product_info)
|
||||
|
@ -467,7 +467,7 @@ class Item(WebsiteGenerator):
|
||||
|
||||
def set_shopping_cart_data(self, context):
|
||||
from erpnext.shopping_cart.product_info import get_product_info_for_website
|
||||
context.shopping_cart = get_product_info_for_website(self.name)
|
||||
context.shopping_cart = get_product_info_for_website(self.name, skip_quotation_creation=True)
|
||||
|
||||
def add_default_uom_in_conversion_factor_table(self):
|
||||
uom_conv_list = [d.uom for d in self.get("uoms")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user