Hi,
I am using health 4.2. I noticed than when you assign a health_prof to an Appointment that is already createds (exists at the database level) and the state changes to Confirmed, the Appointment ID doesn't autocomplete.
You can do so adding to the write classmethod
(.....)
# Check if the Appointment ID is set
if (values.get('state') or appointment.state) in ['confirmed', 'checked', 'done'] \
and (values.get('healthprof') or appointment.healthprof) \
and (values.get('patient') or appointment.patient) \
and not
appointment.name:
values['name'] = cls.generate_code()
(......)
Regards.
Francisco