clinic/netforce_clinic/models/cycle.py

28 lines
860 B
Python

from netforce.model import Model, fields
from netforce.access import get_active_company
class Cycle(Model):
_name="clinic.cycle"
_string="Cycle"
_fields={
"name": fields.Char("Name",required=True,search=True),
'duration': fields.Integer("Duration (hrs)"),
'sequence': fields.Integer("Sequence"),
'company_id': fields.Many2One("company", "Company"),
'hd_cases': fields.One2Many("clinic.hd.case","cycle_id", "HD Cases"),
'visits': fields.One2Many("clinic.visit","cycle_id", "Visits"),
'cycle_items': fields.One2Many("clinic.cycle.item","cycle_id", "Cycle Items"),
'var_k': fields.Float("K"),
'color': fields.Char("Color"),
}
_defaults={
'duration': 1,
'sequence': 1,
'company_id': lambda *a: get_active_company(),
}
Cycle.register()