fix: tests

(cherry picked from commit 035b3cb61e)
This commit is contained in:
Mihir Kandoi
2026-01-21 15:58:46 +05:30
committed by Mergify
parent 91199ea9c9
commit 6fa60d2f1a
2 changed files with 4 additions and 1 deletions

View File

@@ -670,7 +670,7 @@ class StockReconciliation(StockController):
has_batch_no, has_serial_no = frappe.get_value( has_batch_no, has_serial_no = frappe.get_value(
"Item", item_code, ["has_batch_no", "has_serial_no"] "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: if has_batch_no and not row.batch_no:
raise frappe.ValidationError(_("Please enter Batch No")) raise frappe.ValidationError(_("Please enter Batch No"))
if has_serial_no and not row.serial_no: if has_serial_no and not row.serial_no:

View File

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