Code field is enabled/disabled when the checkbox changes. Code is are re-generated when the checkbox is activated and the machine isn't saved yet.