24 lines
551 B
Python
24 lines
551 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"),
|
|
'comapany_id': fields.Many2One("company", "Company"),
|
|
|
|
}
|
|
|
|
_defaults={
|
|
'duration': 1,
|
|
'sequence': 1,
|
|
'comapany_id': lambda *a: get_active_company(),
|
|
}
|
|
|
|
|
|
Cycle.register()
|