changeset 3428:b9fc9d2ad520

health: Check for federation country before assigning it to the Domiciliary Unit
author Luis Falcon <falcon@gnuhealth.org>
date Thu, 31 Oct 2019 16:33:01 +0000
parents 08f2c468cae7
children 8714dec41129
files tryton/health/health.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health/health.py
+++ b/tryton/health/health.py
@@ -327,7 +327,8 @@
     @staticmethod
     def default_address_country():
         Fedcountry = Pool().get('gnuhealth.federation.country.config')(1)
-        return int(Fedcountry.country)
+        if (Fedcountry and Fedcountry.country):
+            return int(Fedcountry.country)
 
     @classmethod
     def __setup__(cls):