mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: validation for document status
(cherry picked from commit 96e2e356b6)
This commit is contained in:
committed by
Mergify
parent
b5417af6f5
commit
0b2f53fefe
@@ -307,6 +307,18 @@ class SerialBatchBundle:
|
||||
if docstatus == 0:
|
||||
self.submit_serial_and_batch_bundle()
|
||||
|
||||
if (
|
||||
frappe.db.count(
|
||||
"Serial and Batch Entry", {"parent": self.sle.serial_and_batch_bundle, "docstatus": 0}
|
||||
)
|
||||
> 0
|
||||
):
|
||||
frappe.throw(
|
||||
_("Serial and Batch Bundle {0} is not submitted").format(
|
||||
bold(self.sle.serial_and_batch_bundle)
|
||||
)
|
||||
)
|
||||
|
||||
if self.item_details.has_serial_no == 1:
|
||||
self.set_warehouse_and_status_in_serial_nos()
|
||||
|
||||
@@ -354,10 +366,6 @@ class SerialBatchBundle:
|
||||
doc.flags.ignore_voucher_validation = True
|
||||
doc.submit()
|
||||
|
||||
for row in doc.entries:
|
||||
if row.docstatus == 0:
|
||||
frappe.throw(_("Serial and Batch Bundle {0} is not submitted").format(bold(doc.name)))
|
||||
|
||||
def set_warehouse_and_status_in_serial_nos(self):
|
||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos as get_parsed_serial_nos
|
||||
|
||||
|
||||
Reference in New Issue
Block a user