From 6adee5822aadc88c3d8f5d77efb25b66d9aaf978 Mon Sep 17 00:00:00 2001 From: ONION <2275333053@qq.com> Date: Thu, 4 Jul 2024 19:13:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_notice/__manifest__.py | 2 +- yuthon_notice/models/yuthon_notice.py | 4 ++-- yuthon_notice/views/notice_category.xml | 10 +++++----- yuthon_notice/views/yuthon_ntice_views.xml | 22 ++++++++++++++-------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/yuthon_notice/__manifest__.py b/yuthon_notice/__manifest__.py index 665be5816..6b7410d78 100644 --- a/yuthon_notice/__manifest__.py +++ b/yuthon_notice/__manifest__.py @@ -14,8 +14,8 @@ 'data': [ 'security/ir.model.access.csv', 'data/approval_category_type_data.xml', - 'views/notice_category.xml', 'views/yuthon_ntice_views.xml', + 'views/notice_category.xml', ], 'installable': True, 'application': True, diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py index e6c0132c7..db4f282a9 100644 --- a/yuthon_notice/models/yuthon_notice.py +++ b/yuthon_notice/models/yuthon_notice.py @@ -26,12 +26,12 @@ class YuthonNotice(models.Model): for pub in self: data_str = '' de_str = [de.name for de in pub.department_ids] if pub.department_ids else data_str - if len(de_str) <= 1: + if len(de_str) == 1: de_str = de_str[0] else: de_str = ','.join(de_str) em_str = [em.name for em in pub.employee_ids] if pub.employee_ids else data_str - if len(em_str) <= 1: + if len(em_str) == 1: em_str = em_str[0] else: em_str = ','.join(em_str) diff --git a/yuthon_notice/views/notice_category.xml b/yuthon_notice/views/notice_category.xml index 54d8c79ce..6f7f3aff6 100644 --- a/yuthon_notice/views/notice_category.xml +++ b/yuthon_notice/views/notice_category.xml @@ -27,10 +27,10 @@ + id="yuthon_notice_approval_menu" + parent="yuthon_notice_menu_config_root" + name="通知公告审批" + action="approval_notice_category_action" + sequence="10"/> \ No newline at end of file diff --git a/yuthon_notice/views/yuthon_ntice_views.xml b/yuthon_notice/views/yuthon_ntice_views.xml index ab399e573..cbc1a2a90 100644 --- a/yuthon_notice/views/yuthon_ntice_views.xml +++ b/yuthon_notice/views/yuthon_ntice_views.xml @@ -61,16 +61,22 @@ - issue.library.search - issue.library + yuthon.notice.search + yuthon.notice - - - - - - + + + + + + + + + + + + From f02e1607b7588fbb7dc270a8c1ac868968d92d41 Mon Sep 17 00:00:00 2001 From: ONION <2275333053@qq.com> Date: Tue, 9 Jul 2024 16:09:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=81=87=E6=9C=9F=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_approval/__manifest__.py | 1 + yuthon_approval/models/__init__.py | 1 + yuthon_approval/models/holiday_setting.py | 17 +++- yuthon_approval/security/approval_process.xml | 6 ++ yuthon_approval/security/ir.model.access.csv | 1 + yuthon_approval/views/holiday_setting.xml | 77 +++++++++++++++++++ 6 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 yuthon_approval/views/holiday_setting.xml diff --git a/yuthon_approval/__manifest__.py b/yuthon_approval/__manifest__.py index ca6bcd668..3a632047f 100644 --- a/yuthon_approval/__manifest__.py +++ b/yuthon_approval/__manifest__.py @@ -21,6 +21,7 @@ 'views/inherit_approval_request_views.xml', 'views/approval_process_views.xml', 'views/approval_notice_note_views.xml', + 'views/holiday_setting.xml', 'views/approval_user_views.xml', 'views/issue_library_views.xml', 'views/send_receive_messages_management.xml', diff --git a/yuthon_approval/models/__init__.py b/yuthon_approval/models/__init__.py index 7077ee15e..0cbbb6e50 100644 --- a/yuthon_approval/models/__init__.py +++ b/yuthon_approval/models/__init__.py @@ -5,4 +5,5 @@ from . import inherit_approval_request from . import approval_category_approver from . import approval_notice_note from . import issue_library +from . import holiday_setting diff --git a/yuthon_approval/models/holiday_setting.py b/yuthon_approval/models/holiday_setting.py index 79b1c8e81..3184ed731 100644 --- a/yuthon_approval/models/holiday_setting.py +++ b/yuthon_approval/models/holiday_setting.py @@ -8,5 +8,18 @@ class HolidaySetting(models.Model): _description = '假期类型配置' _rec_name = 'name' - name = fields.Char(string="假期类型") - + company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company) + department_id = fields.Many2one('hr.department', string='部门') + name = fields.Selection([('bride', '婚嫁'), ('maternity', '产假'), + ('family_planning', '计生假'), ('bereavement', '丧假'), ('years', '年假'), + ('family', '探亲假'), ('sick', '病假'), ('examination', '考试假'), + ('Parent_conference', '家长会假'), ('leave', '事假')], string="假期类型") + gender = fields.Selection([('man', '男'), ('woman', '女')], string="性别") + enjoyment_conditions = fields.Char(string="享受条件") + annual = fields.Char(string="年次") + holiday_days = fields.Char(string="假期天数") + travel_holiday = fields.Char(string="路程假") + reception = fields.Char(string="待遇") + rest_provision = fields.Char(string="休假规定") + rest_conditions = fields.Char(string="休假条件") + remark = fields.Char(string="备注") diff --git a/yuthon_approval/security/approval_process.xml b/yuthon_approval/security/approval_process.xml index 8fa61beb3..dcc72b686 100644 --- a/yuthon_approval/security/approval_process.xml +++ b/yuthon_approval/security/approval_process.xml @@ -12,5 +12,11 @@ [('company_id', 'in', company_ids + [False])] + + + 假期多公司权限 + + [('company_id', 'in', company_ids + [False])] + \ No newline at end of file diff --git a/yuthon_approval/security/ir.model.access.csv b/yuthon_approval/security/ir.model.access.csv index d17274bd5..af5aa2b2e 100644 --- a/yuthon_approval/security/ir.model.access.csv +++ b/yuthon_approval/security/ir.model.access.csv @@ -7,6 +7,7 @@ access_approval_notice_wizard,approval_notice_wizard,model_approval_notice_wizar access_approval_refuse_wizard,approval_refuse_wizard,model_approval_refuse_wizard,base.group_user,1,1,1,1 access_approval_notice_note_users,approval_notice_note_user,model_approval_notice_note,base.group_user,1,1,1,1 access_issue_library,issue_library,model_issue_library,base.group_user,1,1,1,1 +access_holiday_setting,holiday_setting,model_holiday_setting,base.group_user,1,1,1,1 diff --git a/yuthon_approval/views/holiday_setting.xml b/yuthon_approval/views/holiday_setting.xml new file mode 100644 index 000000000..3fb371295 --- /dev/null +++ b/yuthon_approval/views/holiday_setting.xml @@ -0,0 +1,77 @@ + + + + holiday.setting.tree + holiday.setting + + + + + + + + + + + + + + + + holiday.setting.tree + holiday.setting + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + +
+
+
+
+ + + holiday.setting.search + holiday.setting + + + + + + + + 假期类型配置 + holiday.setting + tree,form + + + + +
\ No newline at end of file