From what I understood you want a method on a button which changes state based on some value
@api.multi
def change_state(self):
#serach all records
records = self.env['your.object.name'].search([('state','=','new_order')])#this will search all records in the given object with state == 'new_order
#you have record set of all records in state 'new_order' now you can iterate over using for loop
for record in records:
#now record is single recordset you can access any field of your object with dot ('.') operator
if record.pnp == 'rom': # no need to check state more becuase now you have only filtered records with state 'new_order' only
record.write({'state' : 'royal'}) #'royal' state must be present in options
else:
record.write({'state' : 'in'}) #'in' state must be present in options