mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-26 14:41:42 +01:00
fix: dont update rate of free item when batch is updated
(cherry picked from commit a3596f717b)
# Conflicts:
# erpnext/stock/get_item_details.py
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,8 +1051,13 @@ 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)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
if item_price and item_price[0][2] == params.get("uom"):
|
if item_price and item_price[0][2] == params.get("uom"):
|
||||||
return item_price[0][1]
|
return item_price[0][1]
|
||||||
|
=======
|
||||||
|
if item_price and item_price[0].uom == pctx.uom and not pctx.get("items")[0].get("is_free_item"):
|
||||||
|
return item_price[0].price_list_rate
|
||||||
|
>>>>>>> a3596f717b (fix: dont update rate of free item when batch is updated)
|
||||||
|
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user