From bfe25f64a3a4abacfa6fdc9b6b2bf62d4cbbe689 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 8 May 2025 11:25:33 +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/models/inherit_hr_leave.py | 5 ++---
yuthon_hr_attendance/models/hr_attendance.py | 5 +++--
.../models/hr_attendance_detail_wechat.py | 3 ++-
.../security/planning_group.xml | 11 ++++++++++-
.../hr_attendance_detail_wechat_views.xml | 18 ++++++++++++++++--
.../views/hr_attendance_views.xml | 3 +--
.../views/hr_attendance_wechat_views.xml | 1 -
7 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py
index ba2d29a30..015242ff7 100644
--- a/yuthon_holiday/models/inherit_hr_leave.py
+++ b/yuthon_holiday/models/inherit_hr_leave.py
@@ -305,7 +305,7 @@ class HolidaysRequestBatch(models.Model):
column1='leave_id',
column2='attachment_id'
)
- holiday_allowance = fields.Text(string="常用假期额度", compute='_compute_holiday_allowance', store=True)
+ holiday_allowance = fields.Char(string="常用假期额度", compute='_compute_holiday_allowance', store=True)
active = fields.Boolean('Active', default=True, tracking=True)
def _get_default_name_title(self):
@@ -409,8 +409,7 @@ class HolidaysRequestBatch(models.Model):
number_of_days = int(leave_id.number_of_days)
else:
number_of_days = 0
- record.holiday_allowance = (f"1.年假分配{number_of_days}天\n"
- f"2.加班{all_overtime_hours}小时")
+ record.holiday_allowance = (f"可用额度:年假{number_of_days}天,补休{all_overtime_hours}小时")
class HrLeaveLine(models.Model):
_name = 'hr.leave.line'
diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py
index dca436d2f..7bc0ff7ec 100644
--- a/yuthon_hr_attendance/models/hr_attendance.py
+++ b/yuthon_hr_attendance/models/hr_attendance.py
@@ -23,8 +23,7 @@ class HrAttendance(models.Model):
user_id = fields.Many2one(related='employee_id.user_id', store=True)
absenteeism_card = fields.Boolean(string="旷工", group_operator='count_true')
work_time_type = fields.Selection([('close_day', '休息日'), ('work_day', '工作日')], string="工作时间类型")
- company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company)
- real_company_id = fields.Many2one(related='employee_id.company_id', store=True, string='公司')
+ company_id = fields.Many2one(related='employee_id.company_id', string='公司', index=True, store=True)
on_card_location = fields.Char(string="上班打卡地点")
down_card_location = fields.Char(string="下班打卡地点")
out_card_time = fields.Datetime(string="外出打卡时间")
@@ -41,6 +40,8 @@ class HrAttendance(models.Model):
night_duty = fields.Datetime(string="晚值")
is_approval = fields.Boolean(string="是否审批修正", default=False)
+
+
# @api.model
# def web_read_group(self, domain, fields, groupby, limit=None, offset=0, orderby=False, lazy=True):
# result = super().web_read_group(domain, fields, groupby, limit, offset, orderby, lazy)
diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
index 19e4e2621..15c477e31 100644
--- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
+++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
@@ -38,7 +38,8 @@ class HrAttendanceDetail(models.Model):
name = fields.Char(related='employee_id.name')
employee_id = fields.Many2one('hr.employee', string="员工", readonly=True)
- department_id = fields.Many2one('hr.department', string="部门", related="employee_id.department_id", readonly=True)
+ company_id = fields.Many2one('res.company', string="公司", related="employee_id.company_id", store=True)
+ department_id = fields.Many2one('hr.department', string="部门", related="employee_id.department_id", readonly=True, store=True)
userid = fields.Char(string='userid')
groupname = fields.Char(string='打卡规则名称')
checkin_type = fields.Char(string='打卡类型')
diff --git a/yuthon_hr_attendance/security/planning_group.xml b/yuthon_hr_attendance/security/planning_group.xml
index b77a92869..b0873bd40 100644
--- a/yuthon_hr_attendance/security/planning_group.xml
+++ b/yuthon_hr_attendance/security/planning_group.xml
@@ -107,7 +107,6 @@
[('company_id', 'in', company_ids)]
-
考勤记录详情组
@@ -116,5 +115,15 @@
+
+ 打卡详情公司过滤
+
+ [('company_id', 'in', company_ids)]
+
+
+ 考勤记录多公司
+
+ [('company_id', 'in', company_ids)]
+
diff --git a/yuthon_hr_attendance/views/hr_attendance_detail_wechat_views.xml b/yuthon_hr_attendance/views/hr_attendance_detail_wechat_views.xml
index dff56b8bd..3a32ed067 100644
--- a/yuthon_hr_attendance/views/hr_attendance_detail_wechat_views.xml
+++ b/yuthon_hr_attendance/views/hr_attendance_detail_wechat_views.xml
@@ -35,6 +35,7 @@
+
@@ -51,6 +52,7 @@
+
@@ -64,11 +66,23 @@
-
+
+ hr.attendance.detail.search
+ hr.attendance.detail
+
+
+
+
+
+
+
+
+
+
出勤详情
hr.attendance.detail
- tree,form
+ tree,form,search
diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml
index a671dae56..90b47d88e 100644
--- a/yuthon_hr_attendance/views/hr_attendance_views.xml
+++ b/yuthon_hr_attendance/views/hr_attendance_views.xml
@@ -6,7 +6,7 @@
+ editable="bottom" banner_route="/attendance/banner/route" limit="20">
@@ -25,7 +25,6 @@
-
diff --git a/yuthon_hr_attendance/views/hr_attendance_wechat_views.xml b/yuthon_hr_attendance/views/hr_attendance_wechat_views.xml
index 76dd30e35..8cb39a752 100644
--- a/yuthon_hr_attendance/views/hr_attendance_wechat_views.xml
+++ b/yuthon_hr_attendance/views/hr_attendance_wechat_views.xml
@@ -39,7 +39,6 @@
None
-