changeset 5119:7bb74e161e37

fix bug #62235: Traceback on default health professional
author Luis Falcon <falcon@gnuhealth.org>
date Wed, 30 Mar 2022 18:23:36 +0100
parents 6c219b56fb09
children 8cf9a7181be9
files tryton/health_nursing/health_nursing.py tryton/health_stock/health_stock.py
diffstat 2 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health_nursing/health_nursing.py
+++ b/tryton/health_nursing/health_nursing.py
@@ -410,11 +410,8 @@
     @ModelView.button
     def end_session(cls, sessions):
         # End the session and discharge the patient
-        pool = Pool()
-        HealthProfessional = pool.get('gnuhealth.healthprofessional')
-
         # Change the state of the session to "Done"
-        signing_hp = HealthProfessional.get_health_professional()
+        signing_hp = get_health_professional()
 
         cls.write(sessions, {
             'state': 'done',
--- a/tryton/health_stock/health_stock.py
+++ b/tryton/health_stock/health_stock.py
@@ -128,14 +128,11 @@
     @ModelView.button
     @Workflow.transition('done')
     def done(cls, ambulatory_cares):
-        pool = Pool()
-        HealthProfessional = pool.get('gnuhealth.healthprofessional')
-
         lines_to_ship = {}
         medicaments_to_ship = []
         supplies_to_ship = []
 
-        signing_hp = HealthProfessional.get_health_professional()
+        signing_hp = get_health_professional()
 
         for ambulatory in ambulatory_cares:
             for medicament in ambulatory.medicaments: