Merge pull request #46243 from frappe/mergify/bp/version-15-hotfix/pr-46231

fix: incorrect batch picked (backport #46231)
This commit is contained in:
rohitwaghchaure
2025-03-03 16:15:43 +05:30
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -540,6 +540,8 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
has_batch_no: this.item.has_batch_no,
qty: qty,
based_on: based_on,
posting_date: this.frm.doc.posting_date,
posting_time: this.frm.doc.posting_time,
},
callback: (r) => {
if (r.message) {

View File

@@ -1006,6 +1006,10 @@ class SerialBatchCreation:
elif self.has_serial_no and not self.get("serial_nos"):
self.serial_nos = get_serial_nos_for_outward(kwargs)
elif not self.has_serial_no and self.has_batch_no and not self.get("batches"):
if self.get("posting_date"):
kwargs["posting_date"] = self.get("posting_date")
kwargs["posting_time"] = self.get("posting_time")
self.batches = get_available_batches(kwargs)
def set_auto_serial_batch_entries_for_inward(self):