clinic/netforce_clinic/models/staff_cycle.py

24 lines
676 B
Python
Raw Permalink Normal View History

2014-11-14 01:58:12 +00:00
import time
from netforce.model import Model, fields
from netforce.access import get_active_company
class StaffCycle(Model):
_name="clinic.staff.cycle"
_string="Staff Cycle"
2014-11-14 01:58:12 +00:00
_fields={
"name": fields.Char("Description",search=True),
'staff_id': fields.Many2One("clinic.staff","Staff",required=True),
2014-11-14 01:58:12 +00:00
'cycle_id': fields.Many2One("clinic.cycle","Cycle",required=True),
'date': fields.DateTime("Date"),
'company_id': fields.Many2One("company","Company"),
}
_defaults={
"company_id": lambda *a: get_active_company(),
'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
}
StaffCycle.register()