From 48547737389f43c46daa8b17aa82ddc735b062d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Wed, 24 Jun 2026 18:26:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_employee/models/yuthon_hr_task.py | 43 ++++++++++++ .../views/yuthon_hr_task_views.xml | 63 +++++++++++++++++ .../models/yuthon_property_task.py | 43 ++++++++++++ .../views/yuthon_property_task_views.xml | 67 +++++++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 yuthon_hr_employee/models/yuthon_hr_task.py create mode 100644 yuthon_hr_employee/views/yuthon_hr_task_views.xml create mode 100644 yuthon_property_approval/models/yuthon_property_task.py create mode 100644 yuthon_property_approval/views/yuthon_property_task_views.xml diff --git a/yuthon_hr_employee/models/yuthon_hr_task.py b/yuthon_hr_employee/models/yuthon_hr_task.py new file mode 100644 index 000000000..225a9663d --- /dev/null +++ b/yuthon_hr_employee/models/yuthon_hr_task.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models + + +class YuthonHrTask(models.Model): + _name = 'yuthon.hr.task' + _description = '定时任务配置' + + name = fields.Char(string='名称') + cron_id = fields.Many2one(comodel_name='ir.cron', string='任务') + users_role_id = fields.Many2one(comodel_name='soong.user.role', string='角色') + users_role_group_ids = fields.Many2many(comodel_name='soong.user.role.group', string='角色组') + user_ids = fields.Many2many(comodel_name='res.users', string='人员') + + def action_view_task_confirm(self): + return { + 'type': 'ir.actions.act_window', + 'name': '任务确认记录', + 'res_model': 'yuthon.task.confirm', + 'view_mode': 'tree,form', + 'domain': [('task_id', '=', self.id)], + 'context': {'default_task_id': self.id}, + 'target': 'current', + } + + +class YuthonTaskConfirm(models.Model): + _name = 'yuthon.task.confirm' + _description = '任务确认记录' + + task_id = fields.Many2one(comodel_name='yuthon.hr.task', string='任务', ondelete='cascade') + user_id = fields.Many2one(comodel_name='res.users', string='人员') + state = fields.Selection([('unread', '未阅'), ('read', '已阅')], string='状态', default='unread') + msg_id = fields.Char(string='消息ID') + + def action_view_detail(self): + return { + 'type': 'ir.actions.act_window', + 'res_model': 'yuthon.task.confirm', + 'view_mode': 'form', + 'res_id': self.id, + 'target': 'current', + } diff --git a/yuthon_hr_employee/views/yuthon_hr_task_views.xml b/yuthon_hr_employee/views/yuthon_hr_task_views.xml new file mode 100644 index 000000000..c0f79d98e --- /dev/null +++ b/yuthon_hr_employee/views/yuthon_hr_task_views.xml @@ -0,0 +1,63 @@ + + + + yuthon.hr.task.tree + yuthon.hr.task + + + + + + +