changeset 4852:d3de76b0a7f4

task #16043: Migration to GNU Health 4.0: Migrate and cleanup health_pediatrics_growth_charts_who
author Luis Falcon <falcon@gnuhealth.org>
date Thu, 13 Jan 2022 17:13:14 +0000
parents 0088bb66fda2
children 0fbffa3c4d6a
files tryton/health_pediatrics_growth_charts/__init__.py tryton/health_pediatrics_growth_charts/health_pediatrics_growth_charts.py tryton/health_pediatrics_growth_charts/tryton.cfg tryton/health_pediatrics_growth_charts_who/__init__.py tryton/health_pediatrics_growth_charts_who/report/report_health_pediatrics_growth_charts_who.py tryton/health_pediatrics_growth_charts_who/tryton.cfg tryton/health_pediatrics_growth_charts_who/wizard/wizard_health_pediatrics_growth_charts_who.py
diffstat 7 files changed, 34 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health_pediatrics_growth_charts/__init__.py
+++ b/tryton/health_pediatrics_growth_charts/__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_pediatrics_growth_charts import *
+from .import health_pediatrics_growth_charts 
 
 
 def register():
     Pool.register(
-        PatientEvaluation,
+        health_pediatrics_growth_charts.PatientEvaluation,
         module='health_pediatrics_growth_charts', type_='model')
--- a/tryton/health_pediatrics_growth_charts/health_pediatrics_growth_charts.py
+++ b/tryton/health_pediatrics_growth_charts/health_pediatrics_growth_charts.py
@@ -31,7 +31,8 @@
 class PatientEvaluation(metaclass=PoolMeta):
     __name__ = 'gnuhealth.patient.evaluation'
 
-    age_months = fields.Function(fields.Integer('Patient Age in Months'),
+    age_months = fields.Function(
+        fields.Integer('Patient Age in Months'),
         'get_patient_age_months')
 
     def get_patient_age_months(self, name):
--- a/tryton/health_pediatrics_growth_charts/tryton.cfg
+++ b/tryton/health_pediatrics_growth_charts/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.8.0
+version=3.9.0
 depends:
     health_pediatrics
 
--- a/tryton/health_pediatrics_growth_charts_who/__init__.py
+++ b/tryton/health_pediatrics_growth_charts_who/__init__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 ##############################################################################
 #
 #    GNU Health: The Free Health and Hospital Information System
@@ -20,22 +19,28 @@
 #
 ##############################################################################
 from trytond.pool import Pool
-from .health_pediatrics_growth_charts_who import *
-from .wizard import *
-from .report import *
+from . import health_pediatrics_growth_charts_who
+from . import wizard
+from . import report
 
 
 def register():
     Pool.register(
-        PediatricsGrowthChartsWHO,
+        health_pediatrics_growth_charts_who.PediatricsGrowthChartsWHO,
+        wizard.wizard_health_pediatrics_growth_charts_who.
         OpenPediatricsGrowthChartsWHOReportStart,
         module='health_pediatrics_growth_charts_who', type_='model')
     Pool.register(
+        wizard.wizard_health_pediatrics_growth_charts_who.
         OpenPediatricsGrowthChartsWHOReport,
         module='health_pediatrics_growth_charts_who', type_='wizard')
     Pool.register(
+        report.report_health_pediatrics_growth_charts_who.
         PediatricsGrowthChartsWHOReport,
+        report.report_health_pediatrics_growth_charts_who.
         WeightForAge,
+        report.report_health_pediatrics_growth_charts_who.
         LengthHeightForAge,
+        report.report_health_pediatrics_growth_charts_who.
         BMIForAge,
         module='health_pediatrics_growth_charts_who', type_='report')
--- a/tryton/health_pediatrics_growth_charts_who/report/report_health_pediatrics_growth_charts_who.py
+++ b/tryton/health_pediatrics_growth_charts_who/report/report_health_pediatrics_growth_charts_who.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 ##############################################################################
 #
 #    GNU Health: The Free Health and Hospital Information System
@@ -24,7 +23,7 @@
 from trytond.pool import Pool
 
 __all__ = ['PediatricsGrowthChartsWHOReport', 'WeightForAge',
-    'LengthHeightForAge', 'BMIForAge']
+           'LengthHeightForAge', 'BMIForAge']
 
 _TYPES = {
     '-3': 'p3',
@@ -58,7 +57,8 @@
         Patient = pool.get('gnuhealth.patient')
         Evaluation = pool.get('gnuhealth.patient.evaluation')
 
-        context = super(PediatricsGrowthChartsWHOReport, cls).get_context(records, data)
+        context = super(
+            PediatricsGrowthChartsWHOReport, cls).get_context(records, data)
 
         patient = Patient(data['patient'])
 
@@ -119,6 +119,7 @@
 
         return context
 
+
 class WeightForAge(PediatricsGrowthChartsWHOReport):
     __name__ = 'gnuhealth.pediatrics.growth.charts.who.wfa.report'
 
--- a/tryton/health_pediatrics_growth_charts_who/tryton.cfg
+++ b/tryton/health_pediatrics_growth_charts_who/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.8.0
+version=3.9.0
 depends:
     health_pediatrics_growth_charts
 xml:
--- a/tryton/health_pediatrics_growth_charts_who/wizard/wizard_health_pediatrics_growth_charts_who.py
+++ b/tryton/health_pediatrics_growth_charts_who/wizard/wizard_health_pediatrics_growth_charts_who.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 ##############################################################################
 #
 #    GNU Health: The Free Health and Hospital Information System
@@ -25,7 +24,7 @@
 from trytond.transaction import Transaction
 
 __all__ = ['OpenPediatricsGrowthChartsWHOReportStart',
-    'OpenPediatricsGrowthChartsWHOReport']
+           'OpenPediatricsGrowthChartsWHOReport']
 
 
 class OpenPediatricsGrowthChartsWHOReportStart(ModelView):
@@ -47,15 +46,23 @@
     'Open Pediatrics Growth Charts WHO Report'
     __name__ = 'gnuhealth.pediatrics.growth.charts.who.report.open'
 
-    start = StateView('gnuhealth.pediatrics.growth.charts.who.report.open.start',
-        'health_pediatrics_growth_charts_who.growth_charts_who_open_start_view_form', [
+    start = StateView(
+        'gnuhealth.pediatrics.growth.charts.who.report.open.start',
+        'health_pediatrics_growth_charts_who.\
+        growth_charts_who_open_start_view_form', [
             Button('Cancel', 'end', 'tryton-cancel'),
             Button('Open', 'choose', 'tryton-ok', default=True),
             ])
     choose = StateTransition()
-    print_wfa = StateAction('health_pediatrics_growth_charts_who.report_pediatrics_growth_charts_who_wfa')
-    print_lhfa = StateAction('health_pediatrics_growth_charts_who.report_pediatrics_growth_charts_who_lhfa')
-    print_bmifa = StateAction('health_pediatrics_growth_charts_who.report_pediatrics_growth_charts_who_bmifa')
+    print_wfa = StateAction(
+        'health_pediatrics_growth_charts_who.\
+        report_pediatrics_growth_charts_who_wfa')
+    print_lhfa = StateAction(
+        'health_pediatrics_growth_charts_who.\
+        report_pediatrics_growth_charts_who_lhfa')
+    print_bmifa = StateAction(
+        'health_pediatrics_growth_charts_who.\
+        report_pediatrics_growth_charts_who_bmifa')
 
     def transition_choose(self):
         if self.start.indicator == 'w-f-a':