fix: throw error if no serial numbers are found in Pick List (#21915)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
Rohan 2020-05-26 18:13:25 +05:30 committed by GitHub
parent 56357fafeb
commit d28854b3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,9 @@ class PickList(Document):
for item in self.locations:
if not frappe.get_cached_value('Item', item.item_code, 'has_serial_no'):
continue
if not item.serial_no:
frappe.throw(_("Row #{0}: {1} does not have any available serial numbers in {2}".format(
frappe.bold(item.idx), frappe.bold(item.item_code), frappe.bold(item.warehouse))))
if len(item.serial_no.split('\n')) == item.picked_qty:
continue
frappe.throw(_('For item {0} at row {1}, count of serial numbers does not match with the picked quantity')