Guest User

Untitled

a guest
Dec 17th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1.     @classmethod
  2.     def validate(cls, lots):
  3.         super().validate(lots)
  4.         for lot in lots:
  5.             lot.check_description_length()
  6.  
  7.     def check_description_length(self):
  8.         Warning = Pool().get('res.user.warning')
  9.         if (self.packaging_description
  10.         and len(self.packaging_description) > 20):
  11.             key = '%s@%s' % (self.__name__, self.id)
  12.             if Warning.check(key):
  13.                 raise LotPackagingWarning(key, gettext(
  14.                     'preciball.msg_lot_packaging_description_length'))
Add Comment
Please, Sign In to add comment