from odoo import models, fields, api class YuthonTimedTasks(models.Model): _name = 'yuthon.timed.tasks' _description = '定时任务' sequence = fields.Integer(string='序号') name = fields.Char(string='名称') notice_type = fields.Selection([('attendance', '出勤'), ('schedule', '日程'), ('announcement', '公告'), ('attendance_confirmation', '考勤确认单'), ('salary_slip', '薪资条'), ('process', '流程'), ('other', '其他')], string='类型') active = fields.Boolean(string='有效', default=True) runtime = fields.Datetime(string="运行时间") interval_number = fields.Integer(string='间隔') interval_type = fields.Selection([('minutes', '分钟'), ('hours', '小时'), ('days', '天'), ('weeks', '周'), ('months', '月')], string='运行周期', default='months') model_id = fields.Many2one("ir.model", string="模型")