fix: stock entry for use serial batch fields (backport #39843) (#39844)

fix: stock entry for use serial batch fields (#39843)

(cherry picked from commit e5824fc3f1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-02-11 11:28:48 +05:30
committed by GitHub
parent 63b4d20bdf
commit 43fce29a04
4 changed files with 61 additions and 7 deletions

View File

@@ -156,14 +156,18 @@ class StockController(AccountsController):
if self.doctype == "Stock Reconciliation":
qty = row.qty
type_of_transaction = "Inward"
warehouse = row.warehouse
else:
qty = row.stock_qty
qty = row.stock_qty if self.doctype != "Stock Entry" else row.transfer_qty
type_of_transaction = get_type_of_transaction(self, row)
warehouse = (
row.warehouse if self.doctype != "Stock Entry" else row.s_warehouse or row.t_warehouse
)
sn_doc = SerialBatchCreation(
{
"item_code": row.item_code,
"warehouse": row.warehouse,
"warehouse": warehouse,
"posting_date": self.posting_date,
"posting_time": self.posting_time,
"voucher_type": self.doctype,