From 83c32bb21276bdba4c242edfe663f887dcd89844 Mon Sep 17 00:00:00 2001
From: ONION <2275333053@qq.com>
Date: Sun, 14 Jul 2024 18:52:42 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E6=96=871.3=20=E8=80=83=E5=8B=A41.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
tianhe_approvals/__manifest__.py | 9 +-
.../data/approval_category_type_data.xml | 25 ------
tianhe_approvals/models/__init__.py | 4 -
.../models/generic_forms_outing.py | 13 ---
.../models/generic_forms_remove_holiday.py | 13 ---
.../models/generic_forms_replacement_card.py | 23 -----
tianhe_approvals/models/holiday_approval.py | 24 ------
.../models/inherit_approval_category.py | 7 --
tianhe_approvals/security/ir.model.access.csv | 2 -
.../views/generic_forms_outing.xml | 24 ------
.../views/generic_forms_overtime.xml | 31 -------
.../views/generic_forms_remove_holiday.xml | 24 ------
.../views/generic_forms_replacement_card.xml | 20 -----
.../wuguan_leave_registration_approval.xml | 22 -----
yuthon_hr_attendance/__manifest__.py | 10 ++-
yuthon_hr_attendance/date/attendance_date.xml | 34 ++++++++
yuthon_hr_attendance/models/__init__.py | 8 ++
.../models/attendance_category.py | 17 ++++
yuthon_hr_attendance/models/card_approval.py | 25 ++++++
yuthon_hr_attendance/models/duty_approval.py | 20 +++++
yuthon_hr_attendance/models/go_approval.py | 38 +++++++++
.../models/holidays_approval.py | 37 ++++++++
yuthon_hr_attendance/models/leave_approval.py | 20 +++++
.../models/overtime_approval.py | 17 +++-
.../models/remove_holiday_approval.py | 27 ++++++
.../security/ir.model.access.csv | 7 ++
.../views/all_attendance_menu.xml | 26 ++++++
yuthon_hr_attendance/views/card_approval.xml | 72 ++++++++++++++++
yuthon_hr_attendance/views/duty_approval.xml | 67 +++++++++++++++
yuthon_hr_attendance/views/go_approval.xml | 74 ++++++++++++++++
.../views/holidays_approval.xml | 74 ++++++++++++++++
.../views/hr_attendance_views.xml | 21 -----
yuthon_hr_attendance/views/leave_approval.xml | 67 +++++++++++++++
.../views/overtime_approval.xml | 84 +++++++++++++++++++
.../views/remove_holiday_approval.xml | 74 ++++++++++++++++
yuthon_official/models/yuthon_official.py | 11 ++-
.../views/yuthon_official_views.xml | 25 ++++--
37 files changed, 824 insertions(+), 272 deletions(-)
delete mode 100644 tianhe_approvals/models/generic_forms_outing.py
delete mode 100644 tianhe_approvals/models/generic_forms_remove_holiday.py
delete mode 100644 tianhe_approvals/models/generic_forms_replacement_card.py
delete mode 100644 tianhe_approvals/models/holiday_approval.py
delete mode 100644 tianhe_approvals/views/generic_forms_outing.xml
delete mode 100644 tianhe_approvals/views/generic_forms_overtime.xml
delete mode 100644 tianhe_approvals/views/generic_forms_remove_holiday.xml
delete mode 100644 tianhe_approvals/views/generic_forms_replacement_card.xml
delete mode 100644 tianhe_approvals/views/wuguan_leave_registration_approval.xml
create mode 100644 yuthon_hr_attendance/date/attendance_date.xml
create mode 100644 yuthon_hr_attendance/models/attendance_category.py
create mode 100644 yuthon_hr_attendance/models/card_approval.py
create mode 100644 yuthon_hr_attendance/models/duty_approval.py
create mode 100644 yuthon_hr_attendance/models/go_approval.py
create mode 100644 yuthon_hr_attendance/models/holidays_approval.py
create mode 100644 yuthon_hr_attendance/models/leave_approval.py
rename {tianhe_approvals => yuthon_hr_attendance}/models/overtime_approval.py (79%)
create mode 100644 yuthon_hr_attendance/models/remove_holiday_approval.py
create mode 100644 yuthon_hr_attendance/views/all_attendance_menu.xml
create mode 100644 yuthon_hr_attendance/views/card_approval.xml
create mode 100644 yuthon_hr_attendance/views/duty_approval.xml
create mode 100644 yuthon_hr_attendance/views/go_approval.xml
create mode 100644 yuthon_hr_attendance/views/holidays_approval.xml
create mode 100644 yuthon_hr_attendance/views/leave_approval.xml
create mode 100644 yuthon_hr_attendance/views/overtime_approval.xml
create mode 100644 yuthon_hr_attendance/views/remove_holiday_approval.xml
diff --git a/tianhe_approvals/__manifest__.py b/tianhe_approvals/__manifest__.py
index ac8935199..1a5f33b13 100644
--- a/tianhe_approvals/__manifest__.py
+++ b/tianhe_approvals/__manifest__.py
@@ -13,8 +13,7 @@
'security/ir.model.access.csv',
'data/approval_category_type_data.xml',
'data/approval_group_data.xml',
- 'views/generic_forms_overtime.xml',
- 'views/wuguan_leave_registration_approval.xml',
+ # 'views/generic_forms_overtime.xml',
# 'views/tianhe_dsh_issues_declarations.xml',
# 'views/tianhe_construction_business_approval.xml',
# 'views/tianhe_management_declare_approval.xml',
@@ -26,9 +25,9 @@
# 'views/tianhe_property_submission_approval.xml',
# 'views/tianhe_rental_receipt_approval.xml',
# 'views/tianhe_meeting_file.xml',
- # 'views/generic_forms_replacement_card.xml',
- # 'views/generic_forms_outing.xml',
- # 'views/generic_forms_remove_holiday.xml',
+
+
+
# 'views/tianhe_dimission_approval.xml',
# 'views/tianhe_tryout_official_approval.xml',
# 'views/tianhe_exercitation_tryout_approval.xml',
diff --git a/tianhe_approvals/data/approval_category_type_data.xml b/tianhe_approvals/data/approval_category_type_data.xml
index 122a524fd..c45725dd7 100644
--- a/tianhe_approvals/data/approval_category_type_data.xml
+++ b/tianhe_approvals/data/approval_category_type_data.xml
@@ -62,26 +62,6 @@
天河投资租赁合同收款单
rental_receipt
-
-
- 补卡
- card_approval
-
-
-
- 加班
- overtime_approval
-
-
-
- 外出
- go_approval
-
-
-
- 销假
- remove_holiday_approval
-
离职表
@@ -167,11 +147,6 @@
产权变更表申请表
property_right_alter
-
-
- 请假
- leave_registration
-
物业管理变更申请表
diff --git a/tianhe_approvals/models/__init__.py b/tianhe_approvals/models/__init__.py
index a12c826eb..f6523e3bf 100644
--- a/tianhe_approvals/models/__init__.py
+++ b/tianhe_approvals/models/__init__.py
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from . import inherit_approval_category
from . import inherit_approval_request
-from . import overtime_approval
-from . import holiday_approval
# from . import tianhe_construction_business_approval
# from . import tianhe_process_change_approval
# from . import tianhe_contentious_matter_approval
@@ -15,8 +13,6 @@ from . import holiday_approval
# from . import tianhe_exercitation_tryout_approval
# from . import tianhe_shift_registration_form
# from . import tianhe_meeting_minutes_approval
-# from . import generic_forms_outing
-# from . import generic_forms_remove_holiday
# from . import tianhe_dimission_approval
# from . import tianhe_tryout_official_approval
# from . import tianhe_exercitation_tryout_approval
diff --git a/tianhe_approvals/models/generic_forms_outing.py b/tianhe_approvals/models/generic_forms_outing.py
deleted file mode 100644
index cba7f04d3..000000000
--- a/tianhe_approvals/models/generic_forms_outing.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- coding: utf-8 -*-
-from odoo import api, fields, models, tools
-from odoo.exceptions import ValidationError
-
-
-class GenericFormsOuting(models.Model):
- _inherit = "approval.request"
- _description = '公司通用表单——外出'
-
- missed_meal_charges = fields.Char(string="误餐费")
- apply_unit = fields.Char(string="申请单位")
-
-
diff --git a/tianhe_approvals/models/generic_forms_remove_holiday.py b/tianhe_approvals/models/generic_forms_remove_holiday.py
deleted file mode 100644
index 2561db3b7..000000000
--- a/tianhe_approvals/models/generic_forms_remove_holiday.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- coding: utf-8 -*-
-from odoo import api, fields, models, tools
-from odoo.exceptions import ValidationError
-
-
-class GenericFormsRemoveHoliday(models.Model):
- _inherit = "approval.request"
- _description = '公司通用表单——销假'
-
- entry_time = fields.Datetime(string="入职时间")
- type_remove_holiday = fields.Char(string="销假类型")
-
-
diff --git a/tianhe_approvals/models/generic_forms_replacement_card.py b/tianhe_approvals/models/generic_forms_replacement_card.py
deleted file mode 100644
index 90eb2e9ee..000000000
--- a/tianhe_approvals/models/generic_forms_replacement_card.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- coding: utf-8 -*-
-from odoo import api, fields, models, tools
-from odoo.exceptions import ValidationError
-
-
-class GenericFormsReplacementCard(models.Model):
- _inherit = "approval.request"
- _description = '公司通用表单——补卡'
-
- type_application = fields.Selection([
- ('replacement_card', '补卡'),
- ('overtime', '加班'),
- ('outing', '外出'),
- ('cancellation_of_fakes', '销假'),
- ('Reassignment', '调岗'),
- ('dimission', '离职'),
- ('onboarding', '入职'),
- ('regularization', '转正'),
- ], string="申请类型")
- replacement_time = fields.Datetime(string="补卡时间")
- real_go_work_time = fields.Datetime(string="全天上班")
- real_get_off_work_time = fields.Datetime(string="全天下班")
- type_of_exception = fields.Char(string="异常类型")
diff --git a/tianhe_approvals/models/holiday_approval.py b/tianhe_approvals/models/holiday_approval.py
deleted file mode 100644
index a462417f9..000000000
--- a/tianhe_approvals/models/holiday_approval.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-from odoo import api, fields, models, tools, _
-from odoo.exceptions import ValidationError
-
-
-class WuguanLeaveRegistrationApproval(models.Model):
- _inherit = "approval.request"
- _description = '请假'
-
- leave_category = fields.Many2many('holiday.setting', string="请假类别")
- leave_time = fields.Char(string="请假时间")
- leave_days = fields.Float(string='请假天数', compute='_compute_leave_days', store=True)
-
-
- @api.depends('date_start', 'date_end')
- def _compute_leave_days(self):
- for record in self:
- if record.date_start and record.date_end:
- start_date = fields.Datetime.from_string(record.date_start)
- end_date = fields.Datetime.from_string(record.date_end)
- duration = end_date - start_date
- record.leave_days = duration.days
- else:
- record.leave_days = 0
diff --git a/tianhe_approvals/models/inherit_approval_category.py b/tianhe_approvals/models/inherit_approval_category.py
index e3c596664..f3ec069a1 100644
--- a/tianhe_approvals/models/inherit_approval_category.py
+++ b/tianhe_approvals/models/inherit_approval_category.py
@@ -20,12 +20,6 @@ class ApprovalCategory(models.Model):
('document_processing', '文件处理表'),
('property_submission', '物业部业务呈批表'),
('rental_receipt', '租赁合同收款单'),
- ('card_approval', '补卡审批'),
- ('overtime_approval', '加班审批'),
- ('go_approval', '外出审批'),
- ('duty_approval', '值班审批'),
- ('leave_approval', '调休审批'),
- ('remove_holiday_approval', '销假审批'),
('exit_form', '离职表'),
('tryout_official', '试用期转正式员工'),
('exercitation_tryout', '实习期转试用期'),
@@ -34,7 +28,6 @@ class ApprovalCategory(models.Model):
('meeting_minutes', '会议纪要'),
('engineering', '工程立项'),
('property_right_alter', '产权变更表申请表'),
- ('leave_registration', '请假'),
('tianhe_property_management_reporting', '物业经营报表管理'),
('tianhe_fire_safety_management', '消防安全管理'),
('tianhe_information_ublish_approval_form', '信息发布呈批表'),
diff --git a/tianhe_approvals/security/ir.model.access.csv b/tianhe_approvals/security/ir.model.access.csv
index c768a58f1..001fb06ef 100644
--- a/tianhe_approvals/security/ir.model.access.csv
+++ b/tianhe_approvals/security/ir.model.access.csv
@@ -1,4 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_approval_request_line,approval_request_line,model_approval_request_line,base.group_user,1,1,1,1
-access_overtime_user_line,approval_overtime_user_line,model_overtime_user_line,base.group_user,1,1,1,1
-
diff --git a/tianhe_approvals/views/generic_forms_outing.xml b/tianhe_approvals/views/generic_forms_outing.xml
deleted file mode 100644
index 01d2fa1c2..000000000
--- a/tianhe_approvals/views/generic_forms_outing.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- approvals.category.type.code.generic.forms.outing
- approval.request
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tianhe_approvals/views/generic_forms_overtime.xml b/tianhe_approvals/views/generic_forms_overtime.xml
deleted file mode 100644
index c8d43c110..000000000
--- a/tianhe_approvals/views/generic_forms_overtime.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
- approvals.category.type.code.generic.forms.overtime
- approval.request
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tianhe_approvals/views/generic_forms_remove_holiday.xml b/tianhe_approvals/views/generic_forms_remove_holiday.xml
deleted file mode 100644
index f88e75ad5..000000000
--- a/tianhe_approvals/views/generic_forms_remove_holiday.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- approvals.category.type.code.generic_forms_remove_holiday
- approval.request
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tianhe_approvals/views/generic_forms_replacement_card.xml b/tianhe_approvals/views/generic_forms_replacement_card.xml
deleted file mode 100644
index cd4827040..000000000
--- a/tianhe_approvals/views/generic_forms_replacement_card.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- approvals.category.type.code.generic.forms.replacement.card
- approval.request
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tianhe_approvals/views/wuguan_leave_registration_approval.xml b/tianhe_approvals/views/wuguan_leave_registration_approval.xml
deleted file mode 100644
index eb35febdd..000000000
--- a/tianhe_approvals/views/wuguan_leave_registration_approval.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- approvals.category.type.code.leave.registration
- approval.request
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/yuthon_hr_attendance/__manifest__.py b/yuthon_hr_attendance/__manifest__.py
index 1cf961cc7..734eadde6 100644
--- a/yuthon_hr_attendance/__manifest__.py
+++ b/yuthon_hr_attendance/__manifest__.py
@@ -12,13 +12,21 @@
'category': 'Human Resources/Attendances',
'sequence': 240,
'website': 'https://www.pengyuthon.com',
- 'depends': ['hr_attendance', 'resource', 'approvals', 'base', 'hr'],
+ 'depends': ['hr_attendance', 'resource', 'approvals', 'base', 'hr', 'mail'],
'data': [
'security/ir.model.access.csv',
'security/approval_attendance.xml',
'views/inherit_hr_employee_views.xml',
'views/hr_attendance_views.xml',
'views/resource_calendar_leaves_views.xml',
+ 'views/overtime_approval.xml',
+ 'views/go_approval.xml',
+ 'views/duty_approval.xml',
+ 'views/leave_approval.xml',
+ 'views/holidays_approval.xml',
+ 'views/remove_holiday_approval.xml',
+ 'views/card_approval.xml',
+ 'views/all_attendance_menu.xml',
],
'installable': True,
'application': True,
diff --git a/yuthon_hr_attendance/date/attendance_date.xml b/yuthon_hr_attendance/date/attendance_date.xml
new file mode 100644
index 000000000..c9f7f9544
--- /dev/null
+++ b/yuthon_hr_attendance/date/attendance_date.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+ 加班申请
+
+
+
+
+ 外出申请
+
+
+
+
+ 调休申请
+
+
+
+
+ 请假申请
+
+
+
+
+ 销假申请
+
+
+
+
+ 补卡申请
+
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/models/__init__.py b/yuthon_hr_attendance/models/__init__.py
index 71a9c386d..2e4dbcd48 100644
--- a/yuthon_hr_attendance/models/__init__.py
+++ b/yuthon_hr_attendance/models/__init__.py
@@ -2,5 +2,13 @@
from . import hr_attendance
from . import resource_calendar_leaves
+from . import attendance_category
from . import hr_employee
+from . import overtime_approval
+from . import go_approval
+from . import duty_approval
+from . import leave_approval
+from . import holidays_approval
+from . import remove_holiday_approval
+from . import card_approval
diff --git a/yuthon_hr_attendance/models/attendance_category.py b/yuthon_hr_attendance/models/attendance_category.py
new file mode 100644
index 000000000..3a549bc1c
--- /dev/null
+++ b/yuthon_hr_attendance/models/attendance_category.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools
+from odoo.exceptions import ValidationError, UserError
+
+
+class ApprovalCategory(models.Model):
+ _inherit = 'approval.category'
+ _description = '考勤审批'
+
+ approval_type = fields.Selection(selection_add=[
+ ('card_approval', '补卡审批'),
+ ('overtime_approval', '加班审批'),
+ ('go_approval', '外出审批'),
+ ('duty_approval', '值班审批'),
+ ('leave_approval', '调休审批'),
+ ('leave_registration', '请假'),
+ ('remove_holiday_approval', '销假审批')])
diff --git a/yuthon_hr_attendance/models/card_approval.py b/yuthon_hr_attendance/models/card_approval.py
new file mode 100644
index 000000000..f57cc1be2
--- /dev/null
+++ b/yuthon_hr_attendance/models/card_approval.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools, _
+from datetime import datetime, time, timedelta
+
+
+class CardApprovals(models.Model):
+ _name = 'card.approval'
+ _description = "补卡审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char('名称')
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+ replacement_time = fields.Datetime(string="补卡时间")
+ real_go_work_time = fields.Datetime(string="全天上班")
+ real_get_off_work_time = fields.Datetime(string="全天下班")
+ type_of_exception = fields.Char(string="异常类型")
+ reason_application = fields.Char(string="申请事由")
+
+ def card_approval(self):
+ pass
diff --git a/yuthon_hr_attendance/models/duty_approval.py b/yuthon_hr_attendance/models/duty_approval.py
new file mode 100644
index 000000000..6bcc3e910
--- /dev/null
+++ b/yuthon_hr_attendance/models/duty_approval.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools, _
+from datetime import datetime, time, timedelta
+
+
+class DutyApprovals(models.Model):
+ _name = 'duty.approval'
+ _description = "值班审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char('名称')
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+
+ def duty_approval(self):
+ pass
\ No newline at end of file
diff --git a/yuthon_hr_attendance/models/go_approval.py b/yuthon_hr_attendance/models/go_approval.py
new file mode 100644
index 000000000..27c7c9f1d
--- /dev/null
+++ b/yuthon_hr_attendance/models/go_approval.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools, _
+from datetime import datetime, time, timedelta
+
+
+class GoApprovals(models.Model):
+ _name = 'go.approval'
+ _description = "外出审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char('名称')
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+ user_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别")
+ role_id = fields.Many2one('yuthon.user.role', string="岗位")
+ date_start = fields.Datetime(string="开始时间", default=fields.Datetime.now)
+ date_end = fields.Datetime(string="结束时间")
+ leave_time = fields.Char(string="申请时长")
+ missed_meal_charges = fields.Char(string="误餐费")
+ apply_unit = fields.Char(string="申请单位")
+
+ @api.depends('date_start', 'date_end')
+ def _compute_leave_days(self):
+ for record in self:
+ if record.date_start and record.date_end:
+ start_date = fields.Datetime.from_string(record.date_start)
+ end_date = fields.Datetime.from_string(record.date_end)
+ duration = end_date - start_date
+ record.leave_days = duration.days
+ else:
+ record.leave_days = 0
+
+ def go_approval(self):
+ pass
diff --git a/yuthon_hr_attendance/models/holidays_approval.py b/yuthon_hr_attendance/models/holidays_approval.py
new file mode 100644
index 000000000..d0d33e186
--- /dev/null
+++ b/yuthon_hr_attendance/models/holidays_approval.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools, _
+from datetime import datetime, time, timedelta
+
+
+class HolidaysApprovals(models.Model):
+ _name = 'holidays.approval'
+ _description = "请假审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char('名称')
+ date = fields.Date(string="日期", default=fields.Date.today())
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+ date_start = fields.Datetime(string="开始时间", default=fields.Datetime.now)
+ date_end = fields.Datetime(string="结束时间")
+ leave_category = fields.Many2many('holiday.setting', string="请假类别")
+ leave_time = fields.Char(string="请假时间")
+ leave_days = fields.Float(string='请假天数', compute='_compute_leave_days', store=True)
+ main_text = fields.Text(string='申请事由')
+
+ @api.depends('date_start', 'date_end')
+ def _compute_leave_days(self):
+ for record in self:
+ if record.date_start and record.date_end:
+ start_date = fields.Datetime.from_string(record.date_start)
+ end_date = fields.Datetime.from_string(record.date_end)
+ duration = end_date - start_date
+ record.leave_days = duration.days
+ else:
+ record.leave_days = 0
+
+ def holiday_approval(self):
+ pass
\ No newline at end of file
diff --git a/yuthon_hr_attendance/models/leave_approval.py b/yuthon_hr_attendance/models/leave_approval.py
new file mode 100644
index 000000000..416cdadd4
--- /dev/null
+++ b/yuthon_hr_attendance/models/leave_approval.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools, _
+from datetime import datetime, time, timedelta
+
+
+class LeaveApprovals(models.Model):
+ _name = 'leave.approval'
+ _description = "调休审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char('名称')
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+
+ def leave_approval(self):
+ pass
\ No newline at end of file
diff --git a/tianhe_approvals/models/overtime_approval.py b/yuthon_hr_attendance/models/overtime_approval.py
similarity index 79%
rename from tianhe_approvals/models/overtime_approval.py
rename to yuthon_hr_attendance/models/overtime_approval.py
index ba99a8f74..2e9782032 100644
--- a/tianhe_approvals/models/overtime_approval.py
+++ b/yuthon_hr_attendance/models/overtime_approval.py
@@ -4,15 +4,25 @@ from datetime import datetime, time, timedelta
class OvertimeApprovals(models.Model):
- _inherit = 'approval.request'
+ _name = 'overtime.approval'
_description = "加班审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+ name = fields.Char(string="名称", default="加班申请")
overtime_department_id = fields.Many2one('hr.department', string="加班部门")
overtime_user_ids = fields.One2many('overtime.user.line', 'approval_request_id', string="审批明细行")
+ reason_application = fields.Char(string="申请事由")
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+ overtime_approval_ids = fields.Many2one('approval.request', string='关联审批')
@api.onchange('overtime_department_id')
def onchange_overtime_users(self):
- if self.approval_category_name == 'overtime_approval':
+ if self.overtime_approval_ids.approval_category_name == 'overtime_approval':
users_data_list = []
default_datetime = datetime.combine(datetime.now().date(), time(hour=17, minute=30)) - timedelta(hours=8),
users_list = []
@@ -42,6 +52,9 @@ class OvertimeApprovals(models.Model):
}))
over.overtime_user_ids = users_data_list
+ def go_overtime_approval(self):
+ pass
+
class OvertimeUserLine(models.Model):
_name = 'overtime.user.line'
diff --git a/yuthon_hr_attendance/models/remove_holiday_approval.py b/yuthon_hr_attendance/models/remove_holiday_approval.py
new file mode 100644
index 000000000..0135adc6c
--- /dev/null
+++ b/yuthon_hr_attendance/models/remove_holiday_approval.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools, _
+from datetime import datetime, time, timedelta
+
+
+class RemoveHolidayApprovals(models.Model):
+ _name = 'remove.holiday.approval'
+ _description = "销假审批"
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char('名称')
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
+ department_id = fields.Many2one('hr.department', string="申请人部门")
+ partner_id = fields.Many2one('res.partner', string="来文单位")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
+ entry_time = fields.Datetime(string="入职时间")
+ type_remove_holiday = fields.Char(string="销假类型")
+ user_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别")
+ role_id = fields.Many2one('yuthon.user.role', string="岗位")
+ date_start = fields.Datetime(string="开始时间", default=fields.Datetime.now)
+ date_end = fields.Datetime(string="结束时间")
+ reason_application = fields.Char(string="申请事由")
+
+ def remove_holiday_approval(self):
+ pass
\ No newline at end of file
diff --git a/yuthon_hr_attendance/security/ir.model.access.csv b/yuthon_hr_attendance/security/ir.model.access.csv
index 600c64ec2..076c6e167 100644
--- a/yuthon_hr_attendance/security/ir.model.access.csv
+++ b/yuthon_hr_attendance/security/ir.model.access.csv
@@ -1,3 +1,10 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_resource_calendar_holiday,access.resource.calendar.holiday,model_resource_calendar_holiday,base.group_user,1,1,1,1
+access_overtime_approval,access.overtime.approval,model_overtime_approval,base.group_user,1,1,1,1
+access_go_approval,access.go.approval,model_go_approval,base.group_user,1,1,1,1
+access_duty_approval,access.duty.approval,model_duty_approval,base.group_user,1,1,1,1
+access_leave_approval,access.leave.approval,model_leave_approval,base.group_user,1,1,1,1
+access_holidays_approval,access.holidays.approval,model_holidays_approval,base.group_user,1,1,1,1
+access_remove_holiday_approval,access.remove.holiday.approval,model_remove_holiday_approval,base.group_user,1,1,1,1
+access_card_approval,access.card.approval,model_card_approval,base.group_user,1,1,1,1
diff --git a/yuthon_hr_attendance/views/all_attendance_menu.xml b/yuthon_hr_attendance/views/all_attendance_menu.xml
new file mode 100644
index 000000000..5f74492da
--- /dev/null
+++ b/yuthon_hr_attendance/views/all_attendance_menu.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_hr_attendance/views/card_approval.xml b/yuthon_hr_attendance/views/card_approval.xml
new file mode 100644
index 000000000..fa7b503f2
--- /dev/null
+++ b/yuthon_hr_attendance/views/card_approval.xml
@@ -0,0 +1,72 @@
+
+
+
+
+ card.approval.tree
+ card.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ card.approval.actions
+ card.approval
+
+
+
+
+
+
+ card.approval.search
+ card.approval
+
+
+
+
+
+
+
+
+
+
+
+ 补卡
+ card.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/views/duty_approval.xml b/yuthon_hr_attendance/views/duty_approval.xml
new file mode 100644
index 000000000..b1604f1d1
--- /dev/null
+++ b/yuthon_hr_attendance/views/duty_approval.xml
@@ -0,0 +1,67 @@
+
+
+
+
+ duty.approval.tree
+ duty.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ duty.approval.actions
+ duty.approval
+
+
+
+
+
+
+ duty.approval.search
+ duty.approval
+
+
+
+
+
+
+
+
+
+
+
+ 值班
+ duty.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/views/go_approval.xml b/yuthon_hr_attendance/views/go_approval.xml
new file mode 100644
index 000000000..162ff88bc
--- /dev/null
+++ b/yuthon_hr_attendance/views/go_approval.xml
@@ -0,0 +1,74 @@
+
+
+
+
+ go.approval.tree
+ go.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ go.approval.actions
+ go.approval
+
+
+
+
+
+
+ go.approval.search
+ go.approval
+
+
+
+
+
+
+
+
+
+
+
+ 外出
+ go.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/views/holidays_approval.xml b/yuthon_hr_attendance/views/holidays_approval.xml
new file mode 100644
index 000000000..5d32d42a4
--- /dev/null
+++ b/yuthon_hr_attendance/views/holidays_approval.xml
@@ -0,0 +1,74 @@
+
+
+
+
+ holiday.approval.tree
+ holidays.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ holiday.approval.actions
+ holidays.approval
+
+
+
+
+
+
+ holiday.approval.search
+ holidays.approval
+
+
+
+
+
+
+
+
+
+
+
+ 请假
+ holidays.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml
index 9c08ceb83..f9962902c 100644
--- a/yuthon_hr_attendance/views/hr_attendance_views.xml
+++ b/yuthon_hr_attendance/views/hr_attendance_views.xml
@@ -33,25 +33,4 @@
hr.attendance
tree,form
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/yuthon_hr_attendance/views/leave_approval.xml b/yuthon_hr_attendance/views/leave_approval.xml
new file mode 100644
index 000000000..c8cc4ba94
--- /dev/null
+++ b/yuthon_hr_attendance/views/leave_approval.xml
@@ -0,0 +1,67 @@
+
+
+
+
+ leave.approval.tree
+ leave.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ leave.approval.actions
+ leave.approval
+
+
+
+
+
+
+ leave.approval.search
+ leave.approval
+
+
+
+
+
+
+
+
+
+
+
+ 调休
+ leave.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/views/overtime_approval.xml b/yuthon_hr_attendance/views/overtime_approval.xml
new file mode 100644
index 000000000..93b301034
--- /dev/null
+++ b/yuthon_hr_attendance/views/overtime_approval.xml
@@ -0,0 +1,84 @@
+
+
+
+
+ overtime.approval.tree
+ overtime.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ overtime.approval.actions
+ overtime.approval
+
+
+
+
+
+ overtime.approval.search
+ overtime.approval
+
+
+
+
+
+
+
+
+
+
+
+ 加班
+ overtime.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_hr_attendance/views/remove_holiday_approval.xml b/yuthon_hr_attendance/views/remove_holiday_approval.xml
new file mode 100644
index 000000000..3b6be9765
--- /dev/null
+++ b/yuthon_hr_attendance/views/remove_holiday_approval.xml
@@ -0,0 +1,74 @@
+
+
+
+
+ remove.holiday.approval.tree
+ remove.holiday.approval
+
+
+
+
+
+
+
+
+
+
+
+
+ remove.holiday.approval.actions
+ remove.holiday.approval
+
+
+
+
+
+ remove.holiday.approval.search
+ remove.holiday.approval
+
+
+
+
+
+
+
+
+
+
+
+ 销假
+ remove.holiday.approval
+ tree,form
+
+
\ No newline at end of file
diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py
index e025105ea..f5a290332 100644
--- a/yuthon_official/models/yuthon_official.py
+++ b/yuthon_official/models/yuthon_official.py
@@ -19,7 +19,8 @@ class YuthonOfficial(models.Model):
('financing_post', '投融资发文'),
('official_account_cloud_sms_post_submission', '公众号/云短信发文呈批'),
('post_submission', '发文呈批'),
- ], default='official_issues', string="发文类型")
+ ('official_receipt', '公文收文'),
+ ], default='official_issues', string="公文类型")
official_type = fields.Selection([('receipt', '收文'), ('post', '发文')], string="公文类型")
reference_cold = fields.Integer(string="公文字号")
major_event_category = fields.Integer(string="重大事项所属类别")
@@ -31,10 +32,12 @@ class YuthonOfficial(models.Model):
main_flats = fields.Char(string="主送")
servings_number = fields.Integer(string="份数")
urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
- secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级")
- date = fields.Datetime(string="日期")
+ secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')],
+ string="密级")
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
department_id = fields.Many2one('hr.department', string="申请人部门")
- statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态")
+ statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
+ default='drft')
def go_official_approval(self):
pass
diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml
index b0ac299ba..3c782f65d 100644
--- a/yuthon_official/views/yuthon_official_views.xml
+++ b/yuthon_official/views/yuthon_official_views.xml
@@ -42,22 +42,20 @@
-
+
-
+
-
+
+ invisible="send_type not in ['official_issues','official_issues_for_son','official_receipt']"/>
+ invisible="send_type in ['post_submission','official_account_cloud_sms_post_submission','official_receipt']"/>
@@ -81,4 +79,17 @@
+
+ send.receive.messages.management.search
+ yuthon.official
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file