From 36938420ff0a9d7b8e44184c4684633c2177d395 Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Tue, 15 Oct 2024 19:50:55 +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_holiday/__init__.py | 1 + yuthon_holiday/__manifest__.py | 19 ++++++++++ yuthon_holiday/models/__init__.py | 2 + yuthon_holiday/models/holiday_type_setting.py | 10 +++++ yuthon_holiday/models/yuthon_holiday_type.py | 13 +++++++ yuthon_holiday/security/ir.model.access.csv | 6 +++ yuthon_holiday/views/holiday_type_setting.xml | 33 ++++++++++++++++ yuthon_holiday/views/yuthon_holiday_type.xml | 38 +++++++++++++++++++ yuthon_work_brand/__manifest__.py | 1 + yuthon_work_brand/views/hr_menus.xml | 8 +++- 10 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 yuthon_holiday/__init__.py create mode 100644 yuthon_holiday/__manifest__.py create mode 100644 yuthon_holiday/models/__init__.py create mode 100644 yuthon_holiday/models/holiday_type_setting.py create mode 100644 yuthon_holiday/models/yuthon_holiday_type.py create mode 100644 yuthon_holiday/security/ir.model.access.csv create mode 100644 yuthon_holiday/views/holiday_type_setting.xml create mode 100644 yuthon_holiday/views/yuthon_holiday_type.xml diff --git a/yuthon_holiday/__init__.py b/yuthon_holiday/__init__.py new file mode 100644 index 000000000..9a7e03ede --- /dev/null +++ b/yuthon_holiday/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/yuthon_holiday/__manifest__.py b/yuthon_holiday/__manifest__.py new file mode 100644 index 000000000..c36b433d7 --- /dev/null +++ b/yuthon_holiday/__manifest__.py @@ -0,0 +1,19 @@ +{ + 'name': "yuthon holiday", + 'summary': "假期管理", + 'description': """""", + 'author': 'zhou', + 'version': '0.1', + 'license': 'LGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/holiday_type_setting.xml', + 'views/yuthon_holiday_type.xml', + ], + 'demo': [], + 'depends': ['hr_holidays',], + 'installable': True, + 'application': True, +} + + diff --git a/yuthon_holiday/models/__init__.py b/yuthon_holiday/models/__init__.py new file mode 100644 index 000000000..d4f91516b --- /dev/null +++ b/yuthon_holiday/models/__init__.py @@ -0,0 +1,2 @@ +from . import holiday_type_setting +from . import yuthon_holiday_type \ No newline at end of file diff --git a/yuthon_holiday/models/holiday_type_setting.py b/yuthon_holiday/models/holiday_type_setting.py new file mode 100644 index 000000000..f28058d1b --- /dev/null +++ b/yuthon_holiday/models/holiday_type_setting.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api + + +class HolidayTypeSetting(models.Model): + _name = 'holiday.type.setting' + _description = '假期类别配置' + + + name = fields.Char(string='名称', required=True) diff --git a/yuthon_holiday/models/yuthon_holiday_type.py b/yuthon_holiday/models/yuthon_holiday_type.py new file mode 100644 index 000000000..6c1791a35 --- /dev/null +++ b/yuthon_holiday/models/yuthon_holiday_type.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api + + +class HrLeaveType(models.Model): + _inherit = 'hr.leave.type' + + + holiday_days = fields.Char(string='假期天数', required=True) + vacation_type_id = fields.Many2one('holiday.type.setting', string='假期类型') + travel_leave = fields.Char(string='路程假') + treated = fields.Text(string='待遇') + remarks = fields.Text(string="备注") diff --git a/yuthon_holiday/security/ir.model.access.csv b/yuthon_holiday/security/ir.model.access.csv new file mode 100644 index 000000000..b257d22ed --- /dev/null +++ b/yuthon_holiday/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_holiday_type_setting,access_holiday_type_setting,model_holiday_type_setting,base.group_system,1,1,1,1 + + + + diff --git a/yuthon_holiday/views/holiday_type_setting.xml b/yuthon_holiday/views/holiday_type_setting.xml new file mode 100644 index 000000000..060484b18 --- /dev/null +++ b/yuthon_holiday/views/holiday_type_setting.xml @@ -0,0 +1,33 @@ + + + + holiday.type.setting.tree + holiday.type.setting + + + + + + + + holiday.type.setting.form + holiday.type.setting + +
+ + + + + +
+
+
+ + 假期类别配置 + holiday.type.setting + tree,form + + +
+ + diff --git a/yuthon_holiday/views/yuthon_holiday_type.xml b/yuthon_holiday/views/yuthon_holiday_type.xml new file mode 100644 index 000000000..e41c1b0ba --- /dev/null +++ b/yuthon_holiday/views/yuthon_holiday_type.xml @@ -0,0 +1,38 @@ + + + + yuthon.holiday.type.tree + hr.leave.type + + + + + + + + + yuthon.holiday.type.form + hr.leave.type + + + + 0 + + + 1 + + + + + + + + + + + + 1 + + + + \ No newline at end of file diff --git a/yuthon_work_brand/__manifest__.py b/yuthon_work_brand/__manifest__.py index 0b4a79ab9..a8c3a3c55 100644 --- a/yuthon_work_brand/__manifest__.py +++ b/yuthon_work_brand/__manifest__.py @@ -16,6 +16,7 @@ 'room', 'hr_recruitment', 'hr', + 'yuthon_holiday', 'hr_attendance', 'hr_holidays', 'hr_payroll', diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index 8e1700cd9..2a604603f 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -465,6 +465,12 @@ parent="holiday_set_menu_board" action="hr_holidays.open_view_holiday_status" sequence="1"/> +