From 089ce459854bfb0645d6a772bb96af539fd2d0eb Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 25 Jul 2025 10:16:32 +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 --- attendance_iot/models/attendance_iot.py | 2 +- attendance_iot/models/attendance_iot_user.py | 2 +- attendance_iot/views/attendance_iot_user_views.xml | 14 ++++++++++++++ yuthon_hr_attendance/views/hr_attendance_views.xml | 10 ---------- yuthon_salary/models/inherit_hr_payslip.py | 2 ++ yuthon_salary/wizard/salary_compute_wizard.py | 6 ++++-- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/attendance_iot/models/attendance_iot.py b/attendance_iot/models/attendance_iot.py index be2164238..25e1b5c49 100644 --- a/attendance_iot/models/attendance_iot.py +++ b/attendance_iot/models/attendance_iot.py @@ -50,7 +50,7 @@ class AttendanceIot(models.Model): 'res_model': 'attendance.iot.user', 'view_mode': 'tree', 'domain': [('attendance_iot_id', '=', self.id)], - 'context': {'default_attendance_iot_id': self.id} + 'context': "{'search_default_group_by_department': True}, {'default_attendance_iot_id': self.id}" } def compute_iot_num(self): diff --git a/attendance_iot/models/attendance_iot_user.py b/attendance_iot/models/attendance_iot_user.py index 48a98ce42..eb54092cd 100644 --- a/attendance_iot/models/attendance_iot_user.py +++ b/attendance_iot/models/attendance_iot_user.py @@ -15,7 +15,7 @@ class AttendanceIotUser(models.Model): id_valid = fields.Date(string="有效日期") # 从 employee_id 获取. image_1920 = fields.Image(related='employee_id.avatar_image', string="一寸照") - department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门") + department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门", store=True) mobile_phone = fields.Char(related='employee_id.mobile_phone', string="电话") iot_user_id = fields.Char(string='设备上用户的编码') diff --git a/attendance_iot/views/attendance_iot_user_views.xml b/attendance_iot/views/attendance_iot_user_views.xml index 3cdc35d2f..387a9f28d 100644 --- a/attendance_iot/views/attendance_iot_user_views.xml +++ b/attendance_iot/views/attendance_iot_user_views.xml @@ -18,5 +18,19 @@ + + attendance.iot.user.search + attendance.iot.user + + + + + + + + + + + diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml index 14ee9d188..06fa78161 100644 --- a/yuthon_hr_attendance/views/hr_attendance_views.xml +++ b/yuthon_hr_attendance/views/hr_attendance_views.xml @@ -88,16 +88,6 @@ hr.attendance - - - - - - - - - - diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index 6f1439560..a88e4058c 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -295,6 +295,8 @@ class InheritHrPayslip(models.Model): rec.condolence_fund = line.total if line.name == '春节福利': rec.spring_festival = line.total + if line.name == '临时绩效工资': + rec.based_pay = line.total if line.name == '上年绩效评优': rec.last_year_performance_evaluation = line.total if line.name == '上年社保补缴': diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py index 698364a3a..6ce731fc8 100644 --- a/yuthon_salary/wizard/salary_compute_wizard.py +++ b/yuthon_salary/wizard/salary_compute_wizard.py @@ -115,7 +115,7 @@ class SalaryComputeWizard(models.Model): ], limit=1) if not existing_payslip: - self.env['hr.payslip'].create({ + payslip_id = self.env['hr.payslip'].create({ 'is_bold': is_bold, 'name': employee.name, 'employee_id': employee.id, @@ -125,7 +125,9 @@ class SalaryComputeWizard(models.Model): 'salary_group_id': contract_id.salary_group_id.id if contract_id else employee.contract_id.salary_group_id.id, 'payslip_run_id': payslip_run_id.id, 'state': 'draft', - }).compute_sheet() + }) + payslip_id.compute_sheet() + payslip_id.compute_sheet() internship_ids = self.env['hr.payslip'].search([ ('is_push', '=', False),