from netforce.model import Model, fields from netforce.access import get_active_company class StaffRotation(Model): _name="clinic.staff.rotation" _string="Staff Rotation" _multi_company=True _fields={ "staff_id": fields.Many2One("clinic.staff","Staff", search=True), "level_id": fields.Many2One("clinic.staff.level","Staff Level", search=True), "from_company_id": fields.Many2One("company", "From", search=True), "to_company_id": fields.Many2One("company", "To", search=True), "hire_date": fields.Date("Hire Date", search=True), "resign_date": fields.Date("Resign Date", search=True), "wage": fields.Float("Wage"), "max_cycle": fields.Integer("Max Cycle"), "ot_per_cycle": fields.Float("OT Per Cycle"), "note": fields.Text("Note"), 'company_id': fields.Many2One("company","Company"), } _defaults={ "company_id": lambda *a: get_active_company(), } StaffRotation.register()