blob: fd4e84135bac7c6785ae6e587483ace71c185592 [file] [log] [blame]
Rushabh Mehta3966f1d2012-02-23 12:35:32 +05301# ERPNext - web based ERP (http://erpnext.com)
Anand Doshi885e0742015-03-03 14:55:30 +05302# Copyright (C) 2012 Frappe Technologies Pvt Ltd
Rushabh Mehta2c458992014-04-15 14:36:12 +05303#
Rushabh Mehta3966f1d2012-02-23 12:35:32 +05304# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
Rushabh Mehta2c458992014-04-15 14:36:12 +05308#
Rushabh Mehta3966f1d2012-02-23 12:35:32 +05309# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
Rushabh Mehta2c458992014-04-15 14:36:12 +053013#
Rushabh Mehta3966f1d2012-02-23 12:35:32 +053014# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
Anand Doshi486f9df2012-07-19 13:40:31 +053017from __future__ import unicode_literals
Rushabh Mehta793ba6b2014-02-14 15:47:51 +053018import frappe
Rushabh Mehta2c458992014-04-15 14:36:12 +053019from frappe import _
Rushabh Mehta793ba6b2014-02-14 15:47:51 +053020from frappe.utils import cint, comma_or
Rushabh Mehtad0251332012-02-21 17:26:50 +053021
Anand Doshif9a3c8f2012-12-28 19:42:49 +053022def validate_status(status, options):
23 if status not in options:
Rushabh Mehta2c458992014-04-15 14:36:12 +053024 frappe.throw(_("Status must be one of {0}").format(comma_or(options)))