fix: validate negative quantity for sample collection
This commit is contained in:
parent
fa2c20ea9e
commit
ca1b389c99
@ -3,7 +3,12 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe.utils import flt
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
class SampleCollection(Document):
|
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'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user