fix: tests

This commit is contained in:
Mihir Kandoi
2026-01-21 15:58:46 +05:30
parent 7170a1bd78
commit 035b3cb61e
2 changed files with 4 additions and 1 deletions

View File

@@ -669,7 +669,7 @@ class StockReconciliation(StockController):
has_batch_no, has_serial_no = frappe.get_value(
"Item", item_code, ["has_batch_no", "has_serial_no"]
)
if row.use_serial_batch_fields:
if row.use_serial_batch_fields and self.purpose == "Stock Reconciliation":
if has_batch_no and not row.batch_no:
raise frappe.ValidationError(_("Please enter Batch No"))
if has_serial_no and not row.serial_no:

View File

@@ -1449,6 +1449,7 @@ class TestStockReconciliation(IntegrationTestCase, StockTestMixin):
qty=10,
rate=100,
use_serial_batch_fields=1,
purpose="Opening Stock",
)
sr.reload()
@@ -1591,6 +1592,7 @@ class TestStockReconciliation(IntegrationTestCase, StockTestMixin):
qty=10,
rate=80,
use_serial_batch_fields=1,
purpose="Opening Stock",
)
batch_no = get_batch_from_bundle(reco.items[0].serial_and_batch_bundle)
@@ -1675,6 +1677,7 @@ class TestStockReconciliation(IntegrationTestCase, StockTestMixin):
qty=10,
rate=100,
use_serial_batch_fields=1,
purpose="Opening Stock",
)
sr.reload()