changeset 4857:ba94107421a5

task #16043: Migration to GNU Health 4.0: Migrate and cleanup health_archives
author Luis Falcon <falcon@gnuhealth.org>
date Fri, 14 Jan 2022 11:19:17 +0000
parents 007a3f719e29
children 8df613d84f83
files tryton/health_archives/__init__.py tryton/health_archives/health_archives.py tryton/health_archives/tryton.cfg
diffstat 3 files changed, 16 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health_archives/__init__.py
+++ b/tryton/health_archives/__init__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 ##############################################################################
 #
 #    GNU Health: The Free Health and Hospital Information System
@@ -22,10 +21,10 @@
 ##############################################################################
 
 from trytond.pool import Pool
-from .health_archives import *
+from . import health_archives
 
 
 def register():
     Pool.register(
-        PaperArchive,
+        health_archives.PaperArchive,
         module='health_archives', type_='model')
--- a/tryton/health_archives/health_archives.py
+++ b/tryton/health_archives/health_archives.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 ##############################################################################
 #
 #    GNU Health: The Free Health and Hospital Information System
@@ -21,11 +20,11 @@
 #
 ##############################################################################
 from trytond.model import ModelView, ModelSQL, fields, Unique
-from trytond.pool import Pool
 
 
 __all__ = ['PaperArchive']
 
+
 class PaperArchive(ModelSQL, ModelView):
     'Location of PAPER Patient Clinical History'
 
@@ -35,12 +34,13 @@
         'gnuhealth.patient', 'Patient', required=True,
         help="Patient associated to this newborn baby")
 
-    legacy = fields.Char('Legacy Code', help="If existing, please enter" \
+    legacy = fields.Char(
+        'Legacy Code', help="If existing, please enter"
         " the old / legacy code associated to this Clinical History")
     location = fields.Many2One(
         'gnuhealth.hospital.unit', 'Unit', required=True,
-        help="Location / Unit where this clinical history document" \
-            " should reside.")
+        help="Location / Unit where this clinical history document"
+        " should reside.")
 
     hc_status = fields.Selection((
         ('archived', 'Archived'),
@@ -49,9 +49,9 @@
         ), 'Status', required=True, sort=False)
 
     current_location = fields.Many2One(
-        'gnuhealth.hospital.unit', 'Current Location', 
-        help="Location / Unit where this clinical history document" \
-            " should reside.")
+        'gnuhealth.hospital.unit', 'Current Location',
+        help="Location / Unit where this clinical history document"
+        " should reside.")
 
     identification_code = fields.Function(
         fields.Char('Code'),
@@ -59,13 +59,13 @@
 
     requested_by = fields.Many2One(
         'party.party', 'Requested by',
-        domain=[('is_person', '=', True)], 
+        domain=[('is_person', '=', True)],
         help="Person who last requested the document")
 
     request_date = fields.DateTime("Request Date")
     return_date = fields.DateTime("Returned Date")
-    comments = fields.Char ("Comments")
-    
+    comments = fields.Char("Comments")
+
     @classmethod
     def __setup__(cls):
         '''Create constraints for both the legacy number and patient'''
@@ -73,14 +73,13 @@
 
         t = cls.__table__()
         cls._sql_constraints = [
-            ('legacy_unique', Unique(t,t.legacy),
+            ('legacy_unique', Unique(t, t.legacy),
                 'The history already exists'),
-            ('patient_unique', Unique(t,t.patient),
+            ('patient_unique', Unique(t, t.patient),
                 'The patient history already exists'),
 
             ]
 
-
     @classmethod
     def search_patient_code(cls, name, clause):
         '''Retrieve the Patient Identification Code'''
--- a/tryton/health_archives/tryton.cfg
+++ b/tryton/health_archives/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.8.0
+version=3.9.0
 depends:
     health
 xml: