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

This commit is contained in:
rohitwaghchaure
2024-02-19 10:25:36 +05:30
committed by GitHub
parent 9cb83d2198
commit a4cbfabe0e
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": "",
}
)