fix: validate negative quantity for sample collection
diff --git a/erpnext/healthcare/doctype/sample_collection/sample_collection.py b/erpnext/healthcare/doctype/sample_collection/sample_collection.py
index 2c64320..461f809 100644
--- a/erpnext/healthcare/doctype/sample_collection/sample_collection.py
+++ b/erpnext/healthcare/doctype/sample_collection/sample_collection.py
@@ -3,7 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
+import frappe
from frappe.model.document import Document
+from frappe.utils import flt
+from frappe import _
class SampleCollection(Document):
- pass
+ def validate(self):
+ if flt(self.sample_qty) <= 0:
+ frappe.throw(_('Sample Quantity cannot be negative or 0'), title=_('Invalid Quantity'))