fix: don't set rate for non-stock item in Internal Transfer (backport #39140) (#39169)

* fix: don't set rate for non-stock item in Internal Transfer

(cherry picked from commit e1b0fffd0c)

* test: internal transfer for non-stock item

(cherry picked from commit 57b6a98703)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot]
2024-01-06 11:03:24 +05:30
committed by GitHub
parent 5e4693763a
commit f3882a854f
2 changed files with 22 additions and 0 deletions

View File

@@ -432,6 +432,9 @@ class SellingController(StockController):
items = self.get("items") + (self.get("packed_items") or [])
for d in items:
if not frappe.get_cached_value("Item", d.item_code, "is_stock_item"):
continue
if not self.get("return_against") or (
get_valuation_method(d.item_code) == "Moving Average" and self.get("is_return")
):