changeset 4831:ece120cd96b2

task #16043: Migration to GNU Health 4.0: Initial migration of health_dentistry package
author Luis Falcon <falcon@gnuhealth.org>
date Mon, 10 Jan 2022 14:19:23 +0000
parents 6f97191e212c
children caa485d3be15
files tryton/health_dentistry/__init__.py tryton/health_dentistry/health_dentistry.py tryton/health_dentistry/report/__init__.py tryton/health_dentistry/tryton.cfg tryton/health_dentistry/view/gnuhealth_dentistry_treatment_procedure_tree.xml tryton/health_dentistry/wizard/__init__.py
diffstat 6 files changed, 65 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health_dentistry/__init__.py
+++ b/tryton/health_dentistry/__init__.py
@@ -7,8 +7,8 @@
 #    Copyright (C) 2020-2021 National University of Entre Rios (UNER)
 #                  School of Engineering <saludpublica@ingenieria.uner.edu.ar>
 #    Copyright (C) 2020 Mario Puntin <mario@silix.com.ar>
-#    Copyright (C) 2020-2021 GNU Solidario <health@gnusolidario.org>
-#    Copyright (C) 2020-2021 Luis Falcon <falcon@gnuhealth.org>
+#    Copyright (C) 2020-2022 GNU Solidario <health@gnusolidario.org>
+#    Copyright (C) 2020-2022 Luis Falcon <falcon@gnuhealth.org>
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -27,11 +27,8 @@
 
 from trytond.pool import Pool
 from . import health_dentistry
-from .wizard import patient_set_odontogram
-from .wizard import load_procedure
-from .report import procedures_report
-from .report import odontogram_report
-
+from . import wizard
+from . import report
 
 def register():
     Pool.register(
@@ -39,14 +36,14 @@
         health_dentistry.DentistryTreatment,
         health_dentistry.DentistryProcedure,
         health_dentistry.TreatmentProcedure,
-        patient_set_odontogram.SetOdontogramStart,
-        load_procedure.LoadProcedureStart,
+        wizard.patient_set_odontogram.SetOdontogramStart,
+        wizard.load_procedure.LoadProcedureStart,
         module='health_dentistry', type_='model')
     Pool.register(
-        patient_set_odontogram.SetOdontogram,
-        load_procedure.LoadProcedure,
+        wizard.patient_set_odontogram.SetOdontogram,
+        wizard.load_procedure.LoadProcedure,
         module='health_dentistry', type_='wizard')
     Pool.register(
-        procedures_report.DentistryProcedureReport,
-        odontogram_report.Odontogram,
+        report.procedures_report.DentistryProcedureReport,
+        report.odontogram_report.Odontogram,
         module='health_dentistry', type_='report')
--- a/tryton/health_dentistry/health_dentistry.py
+++ b/tryton/health_dentistry/health_dentistry.py
@@ -7,7 +7,7 @@
 #    Copyright (C) 2020-2021 National University of Entre Rios (UNER)
 #    School of Engineering <saludpublica@ingenieria.uner.edu.ar>
 #    Copyright (C) 2020 Mario Puntin <mario@silix.com.ar>
-#    Copyright (C) 2020-2021 GNU Solidario <health@gnusolidario.org>
+#    Copyright (C) 2020-2022 GNU Solidario <health@gnusolidario.org>
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -29,8 +29,9 @@
 
 from trytond.model import ModelView, ModelSQL, fields, Unique
 from trytond.pyson import Eval, Equal
-from trytond.pool import Pool, PoolMeta
+from trytond.pool import PoolMeta
 
+from trytond.modules.health.core import get_health_professional
 
 __all__ = ['PatientData', 'DentistryTreatment', 'DentistryProcedure',
            'TreatmentProcedure']
@@ -244,10 +245,7 @@
 
     @staticmethod
     def default_healthprof():
-        pool = Pool()
-        HealthProf = pool.get('gnuhealth.healthprofessional')
-        hp = HealthProf.get_health_professional()
-        return hp
+        return get_health_professional()
 
     @classmethod
     def get_procedures_info(cls, treatments, names):
@@ -267,9 +265,7 @@
     @classmethod
     @ModelView.button
     def end_treatment(cls, treatments):
-        HealthProf = Pool().get('gnuhealth.healthprofessional')
-
-        signing_hp = HealthProf.get_health_professional()
+        signing_hp = get_health_professional()
         cls.write(treatments, {
             'state': 'done',
             'signed_by': signing_hp,
new file mode 100755
--- /dev/null
+++ b/tryton/health_dentistry/report/__init__.py
@@ -0,0 +1,24 @@
+##############################################################################
+#
+#    GNU Health: The Free Health and Hospital Information System
+#    Copyright (C) 2008-2022 Luis Falcon <lfalcon@gnusolidario.org>
+#    Copyright (C) 2011-2022 GNU Solidario <health@gnusolidario.org>
+#
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from . import procedures_report 
+from . import odontogram_report
--- a/tryton/health_dentistry/tryton.cfg
+++ b/tryton/health_dentistry/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.8.0
+version=3.9.0
 depends:
     health
 
--- a/tryton/health_dentistry/view/gnuhealth_dentistry_treatment_procedure_tree.xml
+++ b/tryton/health_dentistry/view/gnuhealth_dentistry_treatment_procedure_tree.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tree editable="bottom">
+<tree editable="1">
     <field name="tooth"/>
     <field name="procedure"/>
     <field name="root"/>
new file mode 100755
--- /dev/null
+++ b/tryton/health_dentistry/wizard/__init__.py
@@ -0,0 +1,24 @@
+##############################################################################
+#
+#    GNU Health: The Free Health and Hospital Information System
+#    Copyright (C) 2008-2022 Luis Falcon <lfalcon@gnusolidario.org>
+#    Copyright (C) 2011-2022 GNU Solidario <health@gnusolidario.org>
+#
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from . import patient_set_odontogram 
+from . import load_procedure