mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
Merge pull request #46223 from mihir-kandoi/st30672-3
fix: dont update rate of free item when batch is updated
This commit is contained in:
@@ -227,7 +227,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})
|
||||||
|
|
||||||
@@ -1095,7 +1095,7 @@ def get_batch_based_item_price(pctx: ItemPriceCtx | dict | str, item_code) -> fl
|
|||||||
if not item_price:
|
if not item_price:
|
||||||
item_price = get_item_price(pctx, item_code, ignore_party=True, force_batch_no=True)
|
item_price = get_item_price(pctx, item_code, ignore_party=True, force_batch_no=True)
|
||||||
|
|
||||||
if item_price and item_price[0].uom == pctx.uom:
|
if item_price and item_price[0].uom == pctx.uom and not pctx.get("items", [{}])[0].get("is_free_item", 0):
|
||||||
return item_price[0].price_list_rate
|
return item_price[0].price_list_rate
|
||||||
|
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user