mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-30 09:32:25 +02:00
fix: validate negative quantity for sample collection
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user