2014-10-14 03:57:20 +00:00
|
|
|
from netforce.model import Model, fields
|
2014-10-24 18:04:36 +00:00
|
|
|
from netforce.access import get_active_company
|
2014-10-14 03:57:20 +00:00
|
|
|
|
|
|
|
class Cycle(Model):
|
|
|
|
_name="clinic.cycle"
|
|
|
|
_string="Cycle"
|
|
|
|
|
|
|
|
_fields={
|
|
|
|
"name": fields.Char("Name",required=True,search=True),
|
|
|
|
'duration': fields.Integer("Duration (hrs)"),
|
2014-10-14 07:07:37 +00:00
|
|
|
'sequence': fields.Integer("Sequence"),
|
2014-10-26 04:28:08 +00:00
|
|
|
'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"),
|
2014-10-26 08:48:51 +00:00
|
|
|
'cycle_items': fields.One2Many("clinic.cycle.item","cycle_id", "Cycle Items"),
|
2014-10-26 04:28:08 +00:00
|
|
|
'var_k': fields.Float("K"),
|
2014-10-14 03:57:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_defaults={
|
|
|
|
'duration': 1,
|
2014-10-14 07:07:37 +00:00
|
|
|
'sequence': 1,
|
2014-10-26 04:28:08 +00:00
|
|
|
'company_id': lambda *a: get_active_company(),
|
2014-10-14 03:57:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Cycle.register()
|