from odoo import models, fields class ProductionLine(models.Model): _name = 'sf.production.line' _description = '生产线' name = fields.Char(string='生产线名称') class WorkingProcedure(models.Model): _name = 'sf.working.procedure' _description = '工序' name = fields.Char(string='工序名称') content = fields.Char(string='主要加工内容') WorkingProcedure_to_ProductionLine_id = fields.Many2one('sf.production.line') class ProcedureEquipmentResourceSetting(models.Model): _name = 'sf.procedure.equipment.resource.setting' _description = '工序设备资源设置' equipment_to_working_procedure_id = fields.Many2one('sf.working.procedure', string='工序') name = fields.Char(string='设备名称') machine_tool_name = fields.Char(string='机台号') brand = fields.Char(string='品牌') model = fields.Char(string='型号') production_capacity = fields.Char(string='产能') working_calendar = fields.Many2one('sf.work.log.setting', string='工作日历') working_shift = fields.Char(string='班次') create_time = fields.Datetime(string='新增时间', default=lambda self: fields.Datetime.now()) stale_dated_time = fields.Datetime(string='过期时间') status = fields.Selection([('0', '正常'), ('1', '故障停机'), ('2', '计划停机')], string='设备状态', default='0') participate_in_scheduling = fields.Boolean(string='参与排程', default=True)