Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # Copyright (c) 2015, Frappe and contributors
- # For license information, please see license.txt
- from __future__ import unicode_literals
- import frappe
- from frappe import _
- from frappe.model.document import Document
- class AssetTable(Document):
- def validate(self):
- privious_assign_details=frappe.get_list("Asset Table",fields=["serial_no","item_name"],filters={"name":("!=",self.name)})
- for i in privious_assign_details:
- if i.serial_no==self.serial_no:
- frappe.throw(_("Item {0} with serial no {1} already assigned to employee").format(self,item_name,self.serial_no))
Advertisement
Add Comment
Please, Sign In to add comment