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:
|
||||
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:
|
||||
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:
|
||||
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"):
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user