changeset 2160:d80068c2b7fb

Fix bug #46487: Error column "visit_type" does not exist, installing health module.
author Bruno M. Villasanti <bvillasanti@thymbra.com>
date Sat, 21 Nov 2015 00:57:31 -0300
parents 83e90e1237dd
children 44e2ea2d9e89
files tryton/health/health.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health/health.py
+++ b/tryton/health/health.py
@@ -3288,8 +3288,9 @@
                     pass 
 
         # Merge "chronic" checkups visit types into followup       
-        cursor.execute("update gnuhealth_appointment \
-            set visit_type='followup' where visit_type='chronic'")
+        if table.column_exist('visit_type'):
+            cursor.execute("update gnuhealth_appointment \
+                set visit_type='followup' where visit_type='chronic'")
 
         super(Appointment, cls).__register__(module_name)
 
@@ -4903,8 +4904,9 @@
             table.column_rename('evaluation_date', 'appointment')
 
         # Merge "chronic" checkups visit types into followup       
-        cursor.execute("update gnuhealth_patient_evaluation \
-            set visit_type='followup' where visit_type='chronic'")
+        if table.column_exist('visit_type'):
+            cursor.execute("update gnuhealth_patient_evaluation \
+                set visit_type='followup' where visit_type='chronic'")
 
         super(PatientEvaluation, cls).__register__(module_name)