How to access a field when the view is not a doctype?

I need to access the print format field to modify its value when the invoice is submit, but the print view is not a doctype. I don’t know how to do this. Please someone give me a clue.