mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
fix: do not update item price and last purchase rate for inter transf… (#42616)
fix: do not update item price and last purchase rate for inter transfer transaction
(cherry picked from commit c8af544ef3)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -807,6 +807,9 @@ def get_price_list_rate(args, item_doc, out=None):
|
||||
if price_list_rate is None or frappe.db.get_single_value(
|
||||
"Stock Settings", "update_existing_price_list_rate"
|
||||
):
|
||||
if args.get("is_internal_supplier") or args.get("is_internal_customer"):
|
||||
return out
|
||||
|
||||
if args.price_list and args.rate:
|
||||
insert_item_price(args)
|
||||
|
||||
@@ -818,7 +821,11 @@ def get_price_list_rate(args, item_doc, out=None):
|
||||
if frappe.db.get_single_value("Buying Settings", "disable_last_purchase_rate"):
|
||||
return out
|
||||
|
||||
if not out.price_list_rate and args.transaction_type == "buying":
|
||||
if (
|
||||
not args.get("is_internal_supplier")
|
||||
and not out.price_list_rate
|
||||
and args.transaction_type == "buying"
|
||||
):
|
||||
from erpnext.stock.doctype.item.item import get_last_purchase_details
|
||||
|
||||
out.update(get_last_purchase_details(item_doc.name, args.name, args.conversion_rate))
|
||||
|
||||
Reference in New Issue
Block a user