clinic/netforce_clinic/models/cycle_monthly_line.py

25 lines
835 B
Python

from netforce.model import Model, fields
from netforce.access import get_active_company
class CycleMonthlyLine(Model):
_name="clinic.cycle.monthly.line"
_string="Cycle Monthly Line"
_fields={
"cycle_monthly_id": fields.Many2One("clinic.cycle.monthly","Cycle Monthly"),
'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),
}
_defaults={
'company_id': lambda *a: get_active_company(),
}
CycleMonthlyLine.register()