Temperature after pressure

Is there a way to set Octoprint so that it maintains a nozzle temp of 150 degrees and a bed temp of 40 degrees after printing?

After each print the temperatures are set to 0

Look in OctoPrint's GCODE scripts section for after print complete and add the temp commands.

M109 S150
M190 S40

Yes, that's the g-code for it, but how can I enter it in octoprint so that after printing it doesn't set the temperature to 0 degrees under Printer Settings, Gcoder Scripts -> After printing is complete?

Yes, that's where you could enter it, otherwise you have to do it in your end gcode of the slicer.

OK, thank you, just enter that and you're done