clinic/netforce_clinic/models/cycle.py

24 lines
551 B
Python
Raw Normal View History

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-24 18:04:36 +00:00
'comapany_id': fields.Many2One("company", "Company"),
2014-10-14 03:57:20 +00:00
}
_defaults={
'duration': 1,
2014-10-14 07:07:37 +00:00
'sequence': 1,
2014-10-24 18:04:36 +00:00
'comapany_id': lambda *a: get_active_company(),
2014-10-14 03:57:20 +00:00
}
Cycle.register()