2014-12-08 11:35:39 +00:00
|
|
|
from netforce.model import Model, fields
|
|
|
|
from netforce.access import get_active_company
|
|
|
|
|
|
|
|
class LaborCostLine(Model):
|
|
|
|
_name="clinic.labor.cost.line"
|
|
|
|
_string="Labor Cost Line"
|
|
|
|
_name_field="labor_cost_id"
|
|
|
|
|
|
|
|
_fields={
|
|
|
|
"labor_cost_id": fields.Many2One("clinic.labor.cost","Cycle Item",required=True),
|
|
|
|
'staff_id': fields.Many2One("clinic.staff", "Staff"),
|
|
|
|
'level_id': fields.Many2One("clinic.staff.level", "Level"),
|
2014-12-08 14:54:25 +00:00
|
|
|
'cycle_id': fields.Many2One("clinic.cycle", "Cycle"),
|
2014-12-08 11:35:39 +00:00
|
|
|
'qty': fields.Integer("Qty"),
|
2014-12-08 14:54:25 +00:00
|
|
|
'rate': fields.Float("Rate",scale=2),
|
2014-12-08 11:35:39 +00:00
|
|
|
'amount': fields.Float("Amount",scale=2),
|
2014-12-08 14:54:25 +00:00
|
|
|
'date': fields.Date("Date"),
|
|
|
|
"type": fields.Selection([('staff','Staff'),("doctor","Doctor"),('nurse','Nurse')],"Type",required=True),
|
2014-12-08 11:35:39 +00:00
|
|
|
'company_id': fields.Many2One('company','Company'),
|
|
|
|
}
|
|
|
|
|
|
|
|
_defaults={
|
|
|
|
"company_id": lambda *a: get_active_company(),
|
|
|
|
}
|
2014-12-08 14:54:25 +00:00
|
|
|
|
|
|
|
_order="cycle_id,level_id"
|
2014-12-08 11:35:39 +00:00
|
|
|
|
|
|
|
LaborCostLine.register()
|