fix: validate negative quantity for sample collection

This commit is contained in:
Rucha Mahabal 2020-07-30 16:58:19 +05:30
parent fa2c20ea9e
commit ca1b389c99

View File

@ -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'))