'Validate whether serial no is required for this item'

def validate_item(self):

    item = frappe.get_doc(u'Item', self.item_code)
    if (item.has_serial_no != 1):
        frappe.throw(_(u'Item    {0}    is    not    setup    for    Serial    Nos.    Check    Item    master').format(self.item_code))
    self.item_group = item.item_group
    self.description = item.description
    self.item_name = item.item_name
    self.brand = item.brand
    self.warranty_period = item.warranty_period
