From bfe596006c926b7270a82c93ae9ded415b73710f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Fri, 21 Feb 2025 18:02:08 +0800 Subject: [PATCH] 1 --- yuthon_notice/__manifest__.py | 2 ++ yuthon_notice/data/notice_type_data.xml | 7 +++++++ .../security/yuthon_notice_group.xml | 4 ++-- yuthon_notice/security/yuthon_notice_rule.xml | 15 +++++++++++++++ .../views/yuthon_notice_type_views.xml | 8 +------- yuthon_notice/views/yuthon_notice_views.xml | 19 +++++++++---------- 6 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 yuthon_notice/data/notice_type_data.xml create mode 100644 yuthon_notice/security/yuthon_notice_rule.xml diff --git a/yuthon_notice/__manifest__.py b/yuthon_notice/__manifest__.py index 90e6c6103..5870b54ee 100644 --- a/yuthon_notice/__manifest__.py +++ b/yuthon_notice/__manifest__.py @@ -14,8 +14,10 @@ 'data': [ 'security/ir.model.access.csv', 'security/yuthon_notice_group.xml', + 'security/yuthon_notice_rule.xml', 'data/notice_code_data.xml', 'data/notice_cron_data.xml', + 'data/notice_type_data.xml', 'views/yuthon_notice_views.xml', 'views/yuthon_notice_type_views.xml', 'views/yuthon_confirm_users_views.xml', diff --git a/yuthon_notice/data/notice_type_data.xml b/yuthon_notice/data/notice_type_data.xml new file mode 100644 index 000000000..ce6d7e657 --- /dev/null +++ b/yuthon_notice/data/notice_type_data.xml @@ -0,0 +1,7 @@ + + + 通知 + 公告 + 决定 + 其他 + \ No newline at end of file diff --git a/yuthon_notice/security/yuthon_notice_group.xml b/yuthon_notice/security/yuthon_notice_group.xml index 62eba4773..7ff9f56b3 100644 --- a/yuthon_notice/security/yuthon_notice_group.xml +++ b/yuthon_notice/security/yuthon_notice_group.xml @@ -4,7 +4,7 @@ 通知公告组 - + 用户 @@ -12,7 +12,7 @@ 通知管理员 - + diff --git a/yuthon_notice/security/yuthon_notice_rule.xml b/yuthon_notice/security/yuthon_notice_rule.xml new file mode 100644 index 000000000..69d9fc5fb --- /dev/null +++ b/yuthon_notice/security/yuthon_notice_rule.xml @@ -0,0 +1,15 @@ + + + + yuthon_notice_company_rule_user + + [('employee_ids', 'in', [user.employee_id.id])] + + + + yuthon_notice_company_rule_admin + + [('yuthon_company', '=', user.employee_id.yuthon_company)] + + + \ No newline at end of file diff --git a/yuthon_notice/views/yuthon_notice_type_views.xml b/yuthon_notice/views/yuthon_notice_type_views.xml index 64ef5ad9d..2aecedb15 100644 --- a/yuthon_notice/views/yuthon_notice_type_views.xml +++ b/yuthon_notice/views/yuthon_notice_type_views.xml @@ -22,7 +22,7 @@ id="yuthon_notice_type_setting" parent="yuthon_notice_menu_config_root" name="配置" - groups="yuthon_notice.group_notice_admin" + groups="group_notice_admin" sequence="7"/> - - \ No newline at end of file diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml index 7fe75e371..a3ba8a4c9 100644 --- a/yuthon_notice/views/yuthon_notice_views.xml +++ b/yuthon_notice/views/yuthon_notice_views.xml @@ -138,41 +138,40 @@ - - 我的通知公告 + + 通知公告管理 yuthon.notice tree,form - [('notice_state', '=', 'yes'), ('yuthon_company', '=', user.employee_id.yuthon_company)] - - 通知公告管理 + + 我的通知公告 yuthon.notice tree,form - [('employee_ids', 'in', [user.employee_id.id])] + [('notice_state', '=', 'yes')] \ No newline at end of file