Advertisement
Guest User

Untitled

a guest
Dec 18th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from __future__ import unicode_literals
  2. import webnotes
  3. from webnotes.utils import cint, cstr, flt
  4. from webnotes.model.doc import Document
  5. from webnotes.model.code import get_obj
  6. from webnotes import msgprint, _
  7.  
  8. class CustomDocType(DocType):
  9.     def custom_validate(self):
  10.         if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
  11.             webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement