'Check that supplier is the same after submit if PO is already made'

def validate_supplier_after_submit(self):

    exc_list = []
    for item in self.items:
        if item.supplier:
            supplier = frappe.db.get_value(u'Sales    Order    Item', {u'parent': self.name, u'item_code': item.item_code}, u'supplier')
            if ((item.ordered_qty > 0.0) and (item.supplier != supplier)):
                exc_list.append(_(u'Row    #{0}:    Not    allowed    to    change    Supplier    as    Purchase    Order    already    exists').format(item.idx))
    if exc_list:
        frappe.throw(u'\n'.join(exc_list))
