fix: do not empty serial batch fields (backport #39948) (#39956)

fix: do not empty serial batch fields (#39948)

(cherry picked from commit a4cbfabe0e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-02-19 10:45:28 +05:30
committed by GitHub
parent c81a15eac3
commit acd2e93f8c
7 changed files with 11 additions and 11 deletions

View File

@@ -162,6 +162,9 @@ class StockController(AccountsController):
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
from erpnext.stock.serial_batch_bundle import SerialBatchCreation
if self.get("_action") == "update_after_submit":
return
# To handle test cases
if frappe.flags.in_test and frappe.flags.use_serial_and_batch_fields:
return
@@ -219,7 +222,6 @@ class StockController(AccountsController):
row.db_set(
{
"rejected_serial_and_batch_bundle": sn_doc.name,
"rejected_serial_no": "",
}
)
else:
@@ -227,8 +229,6 @@ class StockController(AccountsController):
row.db_set(
{
"serial_and_batch_bundle": sn_doc.name,
"serial_no": "",
"batch_no": "",
}
)