This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def custom_validate(self): | |
| # serial_no is a custom field in item group which can be any alphanumeric number | |
| serial_no = webnotes.conn.get_value("Item Group", self.doc.item_group, "serial_no") | |
| #increment serial_no value and assign to item_code | |
| next_serial_no = self.next_string(serial_no) | |
| self.doc.item_code = next_serial_no | |
| # update incremented serial_no in item group | |
| webnotes.conn.set_value("Item Group", self.doc.item_group, "serial_no", next_serial_no) |