Merge pull request #35810 from rohitwaghchaure/stock-error-for-service-item
fix: stock error for service item
This commit is contained in:
commit
8816039bd9
@ -162,6 +162,7 @@ def get_next_attribute_and_values(item_code, selected_attributes):
|
|||||||
product_info = get_item_variant_price_dict(exact_match[0], cart_settings)
|
product_info = get_item_variant_price_dict(exact_match[0], cart_settings)
|
||||||
|
|
||||||
if product_info:
|
if product_info:
|
||||||
|
product_info["is_stock_item"] = frappe.get_cached_value("Item", exact_match[0], "is_stock_item")
|
||||||
product_info["allow_items_not_in_stock"] = cint(cart_settings.allow_items_not_in_stock)
|
product_info["allow_items_not_in_stock"] = cint(cart_settings.allow_items_not_in_stock)
|
||||||
else:
|
else:
|
||||||
product_info = None
|
product_info = None
|
||||||
|
@ -219,7 +219,8 @@ class ItemConfigure {
|
|||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
${available_qty === 0 ? '<span class="text-danger">(' + __('Out of Stock') + ')</span>' : ''}
|
${available_qty === 0 && product_info && product_info?.is_stock_item
|
||||||
|
? '<span class="text-danger">(' + __('Out of Stock') + ')</span>' : ''}
|
||||||
|
|
||||||
</div></div>
|
</div></div>
|
||||||
<a href data-action="btn_clear_values" data-item-code="${one_item}">
|
<a href data-action="btn_clear_values" data-item-code="${one_item}">
|
||||||
@ -236,7 +237,8 @@ class ItemConfigure {
|
|||||||
</div>`;
|
</div>`;
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
if (!product_info?.allow_items_not_in_stock && available_qty === 0) {
|
if (!product_info?.allow_items_not_in_stock && available_qty === 0
|
||||||
|
&& product_info && product_info?.is_stock_item) {
|
||||||
item_add_to_cart = '';
|
item_add_to_cart = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user