clinic/netforce_clinic/models/cycle_daily_line.py

27 lines
920 B
Python

from netforce.model import Model, fields
from netforce.access import get_active_company
class CycleDailyLine(Model):
_name="clinic.cycle.daily.line"
_string="Cycle Daily Line"
_fields={
"cycle_daily_id": fields.Many2One("clinic.cycle.daily","Cycle Daily"),
'cycle_id': fields.Many2One("clinic.cycle", "Cycle"),
'staff_id': fields.Many2One("clinic.staff", "Staff"),
'level_id': fields.Many2One("clinic.staff.level", "Level"),
'qty': fields.Integer("Qty"),
'rate': fields.Float("Rate"),
'amount': fields.Float("Amount"),
'company_id': fields.Many2One("company","Company"),
"type": fields.Selection([('staff','Staff'),("doctor","Doctor"),('nurse','Nurse')],"Type",required=True),
'date': fields.Date("Date"),
}
_defaults={
'company_id': lambda *a: get_active_company(),
}
CycleDailyLine.register()