mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
Merge pull request #46235 from frappe/mergify/bp/version-15-hotfix/pr-46223
fix: dont update rate of free item when batch is updated (backport #46223)
This commit is contained in:
@@ -221,7 +221,7 @@ def update_stock(ctx, out, doc=None):
|
|||||||
else:
|
else:
|
||||||
qty -= batch_qty
|
qty -= batch_qty
|
||||||
|
|
||||||
out.update({"batch_no": batch_no, "actual_batch_qty": qty})
|
out.update({"batch_no": batch_no, "actual_batch_qty": batch_qty})
|
||||||
if rate:
|
if rate:
|
||||||
out.update({"rate": rate, "price_list_rate": rate})
|
out.update({"rate": rate, "price_list_rate": rate})
|
||||||
|
|
||||||
@@ -1051,9 +1051,11 @@ def get_batch_based_item_price(params, item_code) -> float:
|
|||||||
if not item_price:
|
if not item_price:
|
||||||
item_price = get_item_price(params, item_code, ignore_party=True, force_batch_no=True)
|
item_price = get_item_price(params, item_code, ignore_party=True, force_batch_no=True)
|
||||||
|
|
||||||
is_free_item = params.get("items", [{}])[0].get("is_free_item")
|
if (
|
||||||
|
item_price
|
||||||
if item_price and item_price[0][2] == params.get("uom") and not is_free_item:
|
and item_price[0][2] == params.get("uom")
|
||||||
|
and not params.get("items", [{}])[0].get("is_free_item", 0)
|
||||||
|
):
|
||||||
return item_price[0][1]
|
return item_price[0][1]
|
||||||
|
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user