Mercurial > hgweb > health
changeset 4858:8df613d84f83
task #16043: Migration to GNU Health 4.0: Migrate and cleanup health_contact_tracing
| author | Luis Falcon <falcon@gnuhealth.org> |
|---|---|
| date | Fri, 14 Jan 2022 16:25:09 +0000 |
| parents | ba94107421a5 |
| children | 2833ff0c82a1 |
| files | tryton/health_contact_tracing/__init__.py tryton/health_contact_tracing/health_contact_tracing.py tryton/health_contact_tracing/tryton.cfg |
| diffstat | 3 files changed, 15 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/tryton/health_contact_tracing/__init__.py +++ b/tryton/health_contact_tracing/__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_contact_tracing import * +from . import health_contact_tracing def register(): Pool.register( - ContactTracing, + health_contact_tracing.ContactTracing, module='health_contact_tracing', type_='model')
--- a/tryton/health_contact_tracing/health_contact_tracing.py +++ b/tryton/health_contact_tracing/health_contact_tracing.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # # GNU Health: The Free Health and Hospital Information System @@ -20,12 +19,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -from trytond.model import ModelView, ModelSQL, fields, Unique -from trytond.pool import Pool + +from trytond.model import ModelView, ModelSQL, fields __all__ = ['ContactTracing'] + class ContactTracing(ModelSQL, ModelView): 'Person Contacts tracing' __name__ = 'gnuhealth.contact_tracing' @@ -38,7 +38,8 @@ 'gnuhealth.pathology', 'Disease', help='Disease to trace') - contact = fields.Many2One('party.party','Contact', + contact = fields.Many2One( + 'party.party', 'Contact', domain=[('is_person', '=', True)], help="Person that the patient has contacted") @@ -58,8 +59,9 @@ ('na', 'Not available'), ), 'Exposure', required=True, sort=False) - exposure_time = fields.Integer("Exposure time", - help="Exposure time in minutes") + exposure_time = fields.Integer( + "Exposure time", + help="Exposure time in minutes") status = fields.Selection(( ('unreached', 'Unreached'), @@ -71,11 +73,11 @@ " has been created and followup evaluations status are stored in the" " evaluations") - context = fields.Char ("Context", - help="Airport, meeting, concert, ...") + context = fields.Char( + "Context", + help="Airport, meeting, concert, ...") - comments = fields.Text ("Comments") - + comments = fields.Text("Comments") @fields.depends('du') def on_change_with_operational_sector(self):
