# Copyright (c) 2021, Xhive LLC
# For license information, please see license.txt

import xhiveframework
from xhiveframework import _, bold
from xhiveframework.model.document import Document


class EmployeeGrievance(Document):
	def on_submit(self):
		if self.status not in ["Invalid", "Resolved"]:
			xhiveframework.throw(
				_("Only Employee Grievance with status {0} or {1} can be submitted").format(
					bold("Invalid"), bold("Resolved")
				)
			)
