fix: if accepted warehouse not selected during rejection then stock ledger not created

(cherry picked from commit 0a71cabab1)
This commit is contained in:
Rohit Waghchaure
2022-04-04 15:10:57 +05:30
committed by mergify-bot
parent 012cab80bf
commit 157461ed02

View File

@@ -464,6 +464,9 @@ class BuyingController(StockController, Subcontracting):
stock_items = self.get_stock_items()
for d in self.get("items"):
if d.item_code not in stock_items:
continue
if d.item_code in stock_items and d.warehouse:
pr_qty = flt(d.qty) * flt(d.conversion_factor)
@@ -489,6 +492,7 @@ class BuyingController(StockController, Subcontracting):
sle = self.get_sl_entries(
d, {"actual_qty": flt(pr_qty), "serial_no": cstr(d.serial_no).strip()}
)
if self.is_return:
outgoing_rate = get_rate_for_return(
self.doctype, self.name, d.item_code, self.return_against, item_row=d