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