import re
def process_PartNo(text):    
    return re.sub(r'(?:PartNoId\s+)?(PartNo-)', r'PartNoId \1', text, flags=re.I)
#######################################################################################
text1 = 'PartNo-001A description 20 units some other description'
text2 = 'PartNoId PartNo-001A description QtyOrd 20 some other description'
text3 = '''
PartNoId
PartNo-001A description QtyOrd 20'
'''
text4 = '''
PartNoId

PartNo-001A description QtyOrd 20'
'''
text5 = ''' 
PartNoId PartNo-001A description QtyOrd 20 some other description
PartNoId PartNo-002A description QtyOrd 20 some other description 
'''
text6 = ''' 
PartNo-001A description QtyOrd 20 some other description
PartNo-002A description QtyOrd 20 some other description 
'''
###########################################################################
print(process_PartNo(text1))
print(process_PartNo(text2))
print(process_PartNo(text3))
print(process_PartNo(text4))
print(process_PartNo(text5))
print(process_PartNo(text6))