From 17466343e0ba74d22b9d2bd98c0b0d53bea3aa4b Mon Sep 17 00:00:00 2001
From: zhouzhou <123@qq.com>
Date: Sun, 29 Sep 2024 18:56:44 +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
---
.../views/yuthon_job_lv_views.xml | 4 +-
yuthon_notice/models/yuthon_notice.py | 17 +-
yuthon_notice/views/yuthon_notice_views.xml | 97 ++++++------
yuthon_work_brand/views/hr_menus.xml | 145 ++++++++----------
yuthon_work_brand/views/work_menus.xml | 8 +-
5 files changed, 126 insertions(+), 145 deletions(-)
diff --git a/yuthon_hr_employee/views/yuthon_job_lv_views.xml b/yuthon_hr_employee/views/yuthon_job_lv_views.xml
index 48973aaa6..ebb7f96c6 100644
--- a/yuthon_hr_employee/views/yuthon_job_lv_views.xml
+++ b/yuthon_hr_employee/views/yuthon_job_lv_views.xml
@@ -22,14 +22,14 @@
- 职级配置
+ 职级管理
yuthon.job.lv
tree,form
diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py
index 8a9a3f6e4..cf276195a 100644
--- a/yuthon_notice/models/yuthon_notice.py
+++ b/yuthon_notice/models/yuthon_notice.py
@@ -10,19 +10,19 @@ class YuthonNotice(models.Model):
_rec_name = 'name'
_order = "sequence desc"
- name = fields.Char(string='通知公告标题')
+ name = fields.Char(string='标题')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('notice_code'))
- user_id = fields.Many2one('res.users', string="创建人", default=lambda self: self.env.user)
+ user_id = fields.Many2one('res.users', string="发布人", default=lambda self: self.env.user)
department_id = fields.Many2one(related='user_id.employee_id.department_id', string="部门")
department_ids = fields.Many2many('hr.department', string='部门范围')
employee_ids = fields.Many2many('hr.employee', string='人员范围')
users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="公司", compute="_compute_company", store=True)
- notice_type_id = fields.Many2one('yuthon.notice.type', string="公告类型")
+ notice_type_id = fields.Many2one('yuthon.notice.type', string="类型")
create_date = fields.Date(string="发布日期")
start_date = fields.Date(string="生效日期", default=fields.Date.today())
end_date = fields.Date(string="终止日期")
- sequence = fields.Integer(string="顺序", default=1)
+ sequence = fields.Integer(string="顺序", default=1, compute='_compute_sequence')
notice_state = fields.Selection([('no', '未发布'), ('yes', '已发布'), ('stop', '已终止')], default='no', string="公告状态")
notice_documents_ids = fields.Many2many('documents.document', string="附件")
is_notice_roger = fields.Selection([('yes', '已读'), ('no', '未读')], default='no', string="确认状态")
@@ -31,6 +31,7 @@ class YuthonNotice(models.Model):
read_number = fields.Integer(string='阅读量', compute="_compute_read_number", store=True)
approval_user_id = fields.Many2one('res.users', string="审核人")
approval_date = fields.Datetime(string="审核日期")
+ is_sticky = fields.Boolean(string="是否置顶")
@api.depends('user_id')
def _compute_company(self):
@@ -65,6 +66,14 @@ class YuthonNotice(models.Model):
def on_sequence(self):
self.sequence = 1
+ @api.onchange('is_sticky')
+ def _compute_sequence(self):
+ for i in self:
+ if i.is_sticky:
+ i.sequence = 1
+ else:
+ i.sequence = 0
+
def no_sequence(self):
self.sequence = 0
diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml
index 84d0d9a68..254013ecd 100644
--- a/yuthon_notice/views/yuthon_notice_views.xml
+++ b/yuthon_notice/views/yuthon_notice_views.xml
@@ -5,17 +5,19 @@
yuthon.notice
+
+
-
-
-
-
+
+
-
-
+
+
+
+
@@ -28,48 +30,42 @@
@@ -79,12 +75,13 @@
yuthon.notice
+
+
-
-
+
@@ -103,10 +100,14 @@
yuthon.notice
+
+
-
+
+
-
+
+
@@ -123,22 +124,20 @@
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
-
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index b47d4063e..fafced01a 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -27,34 +27,11 @@
name="招聘管理"
parent="human_resources_menu_root_board"
sequence="1"/>
-
-
-
-
-
-
+ sequence="1"/>
+ sequence="3"/>
+ sequence="5"/>
-
+ sequence="7"/>
@@ -128,46 +95,66 @@
action="hr.hr_contract_type_action"
sequence="9"/>
-
+ sequence="5"/>
+
+
+ sequence="7"/>
+ sequence="9"/>
+
+
+
-
-
-
+ sequence="7"/>
+ sequence="9"/>
+ sequence="11"/>
+
+ sequence="15"/>
+ sequence="17"/>
+ sequence="19"/>
+ sequence="21"/>
-
+ sequence="7"/>
+ sequence="9"/>
+ sequence="11"/>
+ sequence="13"/>