From 7e6466f7cb24bb44473437322393cefea17fb853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 13 Aug 2025 09:25:30 +0800 Subject: [PATCH 01/21] 1 --- yuthon_hr_attendance/controllers/applet_attendance.py | 2 +- yuthon_official/__manifest__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index dcecd0f64..150f0139b 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -120,7 +120,7 @@ class AppletAttendance(Controller): '缺卡'] else f'

{check_out_str}

' state = "no" message = "超出范围或wifi未连接,不允许打卡" - address_ids = request.env(user=SUPERUSER_ID)["applet.address"].search([]) + address_ids = request.env(user=SUPERUSER_ID)["applet.address"].search([('company_id', '=', employee_id.company_id.id)]) if kw['att_latitude'] != kw['att_longitude']: self_address = self.get_address_from_coords(kw['att_latitude'], kw['att_longitude']) else: diff --git a/yuthon_official/__manifest__.py b/yuthon_official/__manifest__.py index 58f28df2e..b07c56514 100644 --- a/yuthon_official/__manifest__.py +++ b/yuthon_official/__manifest__.py @@ -23,7 +23,7 @@ 'views/yuthon_official_incoming_labor_views.xml', 'views/yuthon_official_party_views.xml', 'views/yuthon_official_incoming_party_views.xml', - 'views/inherit_soong_workflow_insector_views.xml', + # 'views/inherit_soong_workflow_insector_views.xml', 'views/inherit_room_booking_views.xml', 'views/inherit_issue_library_views.xml', 'views/official_menus.xml', From f6dfa71cfec92c5d80624963defb81ddd501831c Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 09:31:22 +0800 Subject: [PATCH 02/21] =?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 --- .../views/property_lease_contract.xml | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 93279d682..d3c4282c9 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -316,6 +316,20 @@ + + + + + + + + + + + + + + @@ -335,20 +349,6 @@ - - - - - - - - - - - - - - @@ -722,6 +722,21 @@ + + + + + + + + + + + + + + @@ -748,21 +763,6 @@ - - - - - - - - - - - - - - From 068cd7805bd5a8c52e6e260303c22a3aa46f30cb Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 10:13:13 +0800 Subject: [PATCH 03/21] =?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_official/views/official_menus.xml | 218 +++++++++++-------- yuthon_work_brand/views/executive_manage.xml | 126 ----------- 2 files changed, 124 insertions(+), 220 deletions(-) diff --git a/yuthon_official/views/official_menus.xml b/yuthon_official/views/official_menus.xml index a368a9d79..6951518e1 100644 --- a/yuthon_official/views/official_menus.xml +++ b/yuthon_official/views/official_menus.xml @@ -1,97 +1,127 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_work_brand/views/executive_manage.xml b/yuthon_work_brand/views/executive_manage.xml index c3985e429..f726a7d4e 100644 --- a/yuthon_work_brand/views/executive_manage.xml +++ b/yuthon_work_brand/views/executive_manage.xml @@ -24,132 +24,6 @@ action="yuthon_trade.view_yuthon_stack_position_action" sequence="20"/> - - - - - - - - - - - - - - - - - - - - - - - - - - Date: Wed, 13 Aug 2025 11:55:49 +0800 Subject: [PATCH 04/21] =?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_property_approval/models/property_lease_alter.py | 2 +- yuthon_property_approval/views/property_eligibility.xml | 2 +- yuthon_property_approval/views/property_lease_alter.xml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/models/property_lease_alter.py b/yuthon_property_approval/models/property_lease_alter.py index 9de7ede33..74c421b06 100644 --- a/yuthon_property_approval/models/property_lease_alter.py +++ b/yuthon_property_approval/models/property_lease_alter.py @@ -6,7 +6,7 @@ from odoo import models, fields, api, exceptions, _ class PropertyLeaseAlter(models.Model): _name = 'property.lease.alter' - _description = '续租审批审批' + _description = '延租审批' _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin'] _rec_name = 'name' diff --git a/yuthon_property_approval/views/property_eligibility.xml b/yuthon_property_approval/views/property_eligibility.xml index 2d5c8637a..69f0b93a7 100644 --- a/yuthon_property_approval/views/property_eligibility.xml +++ b/yuthon_property_approval/views/property_eligibility.xml @@ -50,7 +50,7 @@ - + diff --git a/yuthon_property_approval/views/property_lease_alter.xml b/yuthon_property_approval/views/property_lease_alter.xml index 36a5405fe..c6be7260a 100644 --- a/yuthon_property_approval/views/property_lease_alter.xml +++ b/yuthon_property_approval/views/property_lease_alter.xml @@ -26,6 +26,7 @@ + From b6c19a38e6ad2931ead6e3dea1fcf80bb68c616b Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 14:29:26 +0800 Subject: [PATCH 05/21] =?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_official/__manifest__.py | 2 +- yuthon_official/views/official_menus.xml | 30 +++++++++---------- .../models/property_evaluation_plan.py | 2 ++ .../views/property_eligibility.xml | 9 ++---- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/yuthon_official/__manifest__.py b/yuthon_official/__manifest__.py index 58f28df2e..ff9081b27 100644 --- a/yuthon_official/__manifest__.py +++ b/yuthon_official/__manifest__.py @@ -10,7 +10,7 @@ 'category': 'Human Resources/Attendances', 'version': '0.1', 'license': 'LGPL-3', - 'depends': ['mail', 'hr', 'soong_workflow', 'room', 'yuthon_issue'], + 'depends': ['mail', 'hr', 'soong_workflow', 'room', 'yuthon_issue', 'yuthon_trade'], 'data': [ 'data/official_type_data.xml', 'security/ir.model.access.csv', diff --git a/yuthon_official/views/official_menus.xml b/yuthon_official/views/official_menus.xml index 6951518e1..7cbfa5bed 100644 --- a/yuthon_official/views/official_menus.xml +++ b/yuthon_official/views/official_menus.xml @@ -85,7 +85,21 @@ parent="administrative_offices_root_board" action="yuthon_trade.view_parking_fee_approval_action" sequence="85"/> - + + + - - - \ No newline at end of file diff --git a/yuthon_property/models/property_evaluation_plan.py b/yuthon_property/models/property_evaluation_plan.py index e71f65606..fa1218948 100644 --- a/yuthon_property/models/property_evaluation_plan.py +++ b/yuthon_property/models/property_evaluation_plan.py @@ -33,6 +33,8 @@ class PropertyEvaluationPlan(models.Model): record.lease_form = 'sublease' else: record.lease_form = 'whole' + else: + record.lease_form = False def put_assessment_approval(self): diff --git a/yuthon_property_approval/views/property_eligibility.xml b/yuthon_property_approval/views/property_eligibility.xml index 69f0b93a7..623fbfb0e 100644 --- a/yuthon_property_approval/views/property_eligibility.xml +++ b/yuthon_property_approval/views/property_eligibility.xml @@ -42,17 +42,14 @@ + + + - - - - - - From 4208bf5092847505d8bde4d57fb3493ed41be3c4 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 14:49:22 +0800 Subject: [PATCH 06/21] =?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_work_brand/views/hr_menus.xml | 140 +++++++++++++-------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index a7f5bf5bb..36e0f6c30 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -616,36 +616,11 @@ - - - - - - - - - - + + sequence="1"/> - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ebf2dae389fd498be917ec037edbd3e345dd273f Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 16:17:39 +0800 Subject: [PATCH 07/21] =?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_property_approval/views/property_eligibility.xml | 1 + .../views/property_intention_views.xml | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/yuthon_property_approval/views/property_eligibility.xml b/yuthon_property_approval/views/property_eligibility.xml index 623fbfb0e..4e922749a 100644 --- a/yuthon_property_approval/views/property_eligibility.xml +++ b/yuthon_property_approval/views/property_eligibility.xml @@ -50,6 +50,7 @@ + diff --git a/yuthon_property_approval/views/property_intention_views.xml b/yuthon_property_approval/views/property_intention_views.xml index 77a1009e5..7db185a89 100644 --- a/yuthon_property_approval/views/property_intention_views.xml +++ b/yuthon_property_approval/views/property_intention_views.xml @@ -43,15 +43,13 @@ + + + - - - - - From 0349c369e94498c2d25ef7bc18980f1e6322d040 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 16:53:00 +0800 Subject: [PATCH 08/21] =?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 --- .../models/hr_attendance_detail_wechat.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 7c518f37a..86a6afa44 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -113,19 +113,13 @@ class HrAttendanceDetail(models.Model): """同步打卡记录到hr.attendance 更新上下班打卡时间 """ checkin_date = fields.Date.from_string(record.checkin_time) attendance = self.env['hr.attendance'].search([ - ('employee_id', '=', record.employee_id.id), + ('employee_id.name', '=', '叶华锋'), ('current_data', '=', checkin_date) ], limit=1) if attendance: if not attendance.check_in: attendance.check_in = record.checkin_time - elif not attendance.check_out: - attendance.check_out = record.checkin_time - existing_checkout = fields.Datetime.from_string(attendance.check_out) - new_checkout = fields.Datetime.from_string(record.checkin_time) - # 只在新打卡时间更晚的情况下更新 - if new_checkout > existing_checkout: - attendance.check_out = record.checkin_time + attendance.check_out = record.checkin_time - timedelta(hours=8) # 传参按一个人打卡一次传参 From df804de927690034e261b32bf75e0b08cfee3dc6 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 16:58:30 +0800 Subject: [PATCH 09/21] =?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_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 86a6afa44..b3f8142cc 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -113,7 +113,7 @@ class HrAttendanceDetail(models.Model): """同步打卡记录到hr.attendance 更新上下班打卡时间 """ checkin_date = fields.Date.from_string(record.checkin_time) attendance = self.env['hr.attendance'].search([ - ('employee_id.name', '=', '叶华锋'), + ('employee_id', '=', record.employee_id.id), ('current_data', '=', checkin_date) ], limit=1) if attendance: From 803a616fcc168a973e7ec4ad666ecdb2cbc55f5c Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 17:07:09 +0800 Subject: [PATCH 10/21] =?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_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index b3f8142cc..86a6afa44 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -113,7 +113,7 @@ class HrAttendanceDetail(models.Model): """同步打卡记录到hr.attendance 更新上下班打卡时间 """ checkin_date = fields.Date.from_string(record.checkin_time) attendance = self.env['hr.attendance'].search([ - ('employee_id', '=', record.employee_id.id), + ('employee_id.name', '=', '叶华锋'), ('current_data', '=', checkin_date) ], limit=1) if attendance: From b978bcc890e48a0ae812a0514037111edf6b0d95 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 17:22:42 +0800 Subject: [PATCH 11/21] =?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_hr_attendance/controllers/applet_attendance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index dcecd0f64..7406922cc 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -293,7 +293,7 @@ class AppletAttendance(Controller): # 创建考勤记录 request.env(user=SUPERUSER_ID)["hr.attendance.detail"].create({ 'employee_id': employee_id.id, - 'checkin_time': current_datetime, + 'checkin_time': current_datetime - timedelta(hours=8), 'source': 'mini_programs', 'groupname': groupname, 'checkin_type': checkin_type, From 03e34186736e7bc2cbcb6be3698ce7ab17f6709b Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 17:27:57 +0800 Subject: [PATCH 12/21] =?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_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 86a6afa44..f0149f2e0 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -119,7 +119,7 @@ class HrAttendanceDetail(models.Model): if attendance: if not attendance.check_in: attendance.check_in = record.checkin_time - attendance.check_out = record.checkin_time - timedelta(hours=8) + attendance.check_out = record.checkin_time # 传参按一个人打卡一次传参 From 649276499a60a67fd8ce8ecc10f853e03b8d5621 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 17:29:20 +0800 Subject: [PATCH 13/21] =?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_hr_attendance/controllers/applet_attendance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 7406922cc..dcecd0f64 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -293,7 +293,7 @@ class AppletAttendance(Controller): # 创建考勤记录 request.env(user=SUPERUSER_ID)["hr.attendance.detail"].create({ 'employee_id': employee_id.id, - 'checkin_time': current_datetime - timedelta(hours=8), + 'checkin_time': current_datetime, 'source': 'mini_programs', 'groupname': groupname, 'checkin_type': checkin_type, From 396005d1f41c536ad646f2bde57df33510641e7a Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 18:02:36 +0800 Subject: [PATCH 14/21] =?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_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index f0149f2e0..e2e43cdf3 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -205,7 +205,7 @@ class HrAttendanceDetail(models.Model): if not userid or not checkin_time_stamp: _logger.error('没有抓取到用户出勤信息,异常:{0},用户列表{1}'.format(str(data), str(userid_limit))) return False - checkin_time = datetime.fromtimestamp(checkin_time_stamp) if checkin_time_stamp else None + checkin_time = datetime.fromtimestamp(checkin_time_stamp) - timedelta(hours=8) if checkin_time_stamp else None sch_checkin_time = datetime.fromtimestamp(sch_checkin_time_stamp) if sch_checkin_time_stamp else None return checkin_time, sch_checkin_time From f0db491d3a15f0864454e7403d821aad0a86256f Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 18:06:47 +0800 Subject: [PATCH 15/21] =?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 --- soong_workflow/models/soong_workflow_mixin.py | 21 +++++++++++++------ .../controllers/applet_attendance.py | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index ec637b159..2038580ed 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -340,18 +340,27 @@ class SoongWorkflowMixin(models.AbstractModel): btn for btn in next_node.button_ids if btn.name == '转交' ] - # 判断按钮隐藏条件 如果没有可用的就跳过 + has_visible_transfer_btn = False + # 判断按钮隐藏条件 如果没有可用的就跳过(说明流程最后一步) if not transfer_buttons: has_visible_transfer_btn = True else: - has_visible_transfer_btn = any( - not btn.invisible_expression or - self.search(eval(btn.invisible_expression)) - for btn in transfer_buttons - ) + for btn in transfer_buttons: + if not btn.invisible_expression: + has_visible_transfer_btn = False + break + else: + domain = eval(btn.invisible_expression) + expression_result = self.search(domain) + has_self_in_result = self.id in expression_result.ids + if not has_self_in_result: + has_visible_transfer_btn = False + break + if not has_visible_transfer_btn: skipped_node_names.append(next_node.name) _logger.info(f"跳过节点: {next_node.name},无可见的转交按钮") + # 更新索引 index = state_list.index(matched_key) if index >= len(node_list): diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index dcecd0f64..8d66e997c 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -299,7 +299,7 @@ class AppletAttendance(Controller): 'checkin_type': checkin_type, 'sch_checkin_time': sch_checkin_time, }) - now_time = fields.Datetime.to_datetime(fields.Date.today()) + timedelta(hours=8, days=1) + now_time = fields.Datetime.to_datetime(fields.Date.today()) - timedelta(hours=8, days=1) start_time = now_time - timedelta(days=2) request.env["hr.attendance.detail"].get_hr_attendance_time(employee_id, now_time, start_time) return_data = {'code': '200', 'message': '打卡成功'} From ac111397b9671a73832eeda610044f09fa037c2b Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 18:07:07 +0800 Subject: [PATCH 16/21] =?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_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index e2e43cdf3..f0149f2e0 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -205,7 +205,7 @@ class HrAttendanceDetail(models.Model): if not userid or not checkin_time_stamp: _logger.error('没有抓取到用户出勤信息,异常:{0},用户列表{1}'.format(str(data), str(userid_limit))) return False - checkin_time = datetime.fromtimestamp(checkin_time_stamp) - timedelta(hours=8) if checkin_time_stamp else None + checkin_time = datetime.fromtimestamp(checkin_time_stamp) if checkin_time_stamp else None sch_checkin_time = datetime.fromtimestamp(sch_checkin_time_stamp) if sch_checkin_time_stamp else None return checkin_time, sch_checkin_time From adee280923a83358bc22c536448968242d5471e0 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 18:23:33 +0800 Subject: [PATCH 17/21] =?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_hr_attendance/models/hr_attendance.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 6eee1e0bf..87fb2b8f2 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -111,6 +111,22 @@ class HrAttendance(models.Model): else: record.company_id = False + def write(self, vals): + # 仅在修改check_out字段时执行逻辑 + if 'check_out' in vals: + for record in self: + detail_records = self.env['hr.attendance.detail'].search([ + ('employee_id', '=', record.employee_id.id), + ('checkin_time', '>=', fields.Datetime.to_string(record.current_data)), + ('checkin_time', '<', fields.Datetime.to_string(record.current_data + fields.Date(days=1))) + ]) + + if detail_records: + # 提取所有checkin_time并找出最大值 + max_checkin_time = max(detail_records.mapped('checkin_time')) + vals['check_out'] = max_checkin_time + return super(HrAttendance, self).write(vals) + # @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) From b42857c3639908e2d2c8f19c4af8e60603cd18f9 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 18:26:26 +0800 Subject: [PATCH 18/21] =?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_hr_attendance/models/hr_attendance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 87fb2b8f2..ef0584d94 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -115,10 +115,14 @@ class HrAttendance(models.Model): # 仅在修改check_out字段时执行逻辑 if 'check_out' in vals: for record in self: + target_date = record.current_data + next_day = target_date + timedelta(days=1) detail_records = self.env['hr.attendance.detail'].search([ ('employee_id', '=', record.employee_id.id), - ('checkin_time', '>=', fields.Datetime.to_string(record.current_data)), - ('checkin_time', '<', fields.Datetime.to_string(record.current_data + fields.Date(days=1))) + ('checkin_time', '>=', + fields.Datetime.to_string(fields.Datetime.combine(target_date, fields.Datetime.min.time()))), + ('checkin_time', '<', + fields.Datetime.to_string(fields.Datetime.combine(next_day, fields.Datetime.min.time()))) ]) if detail_records: From 0eb1a4cbc564db12850a3328839a88f2db8e0e84 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 18:28:48 +0800 Subject: [PATCH 19/21] =?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_hr_attendance/models/hr_attendance.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index ef0584d94..6649044ca 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -115,14 +115,15 @@ class HrAttendance(models.Model): # 仅在修改check_out字段时执行逻辑 if 'check_out' in vals: for record in self: - target_date = record.current_data - next_day = target_date + timedelta(days=1) + target_date = record.current_data # date类型 + start_of_day = datetime.combine(target_date, datetime.min.time()) + end_of_day = start_of_day + timedelta(days=1) + start_str = fields.Datetime.to_string(start_of_day) + end_str = fields.Datetime.to_string(end_of_day) detail_records = self.env['hr.attendance.detail'].search([ ('employee_id', '=', record.employee_id.id), - ('checkin_time', '>=', - fields.Datetime.to_string(fields.Datetime.combine(target_date, fields.Datetime.min.time()))), - ('checkin_time', '<', - fields.Datetime.to_string(fields.Datetime.combine(next_day, fields.Datetime.min.time()))) + ('checkin_time', '>=', start_str), + ('checkin_time', '<', end_str) ]) if detail_records: From 7de5651b320325ab6fbbc4f43b7f1a7b92510638 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 19:29:45 +0800 Subject: [PATCH 20/21] =?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 --- soong_workflow/models/soong_workflow_mixin.py | 9 ++++----- soong_workflow/wizard/soong_workflow_comment_wizard.py | 2 ++ yuthon_hr_attendance/models/hr_attendance.py | 4 +--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 2038580ed..6f49befb4 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -340,22 +340,21 @@ class SoongWorkflowMixin(models.AbstractModel): btn for btn in next_node.button_ids if btn.name == '转交' ] - has_visible_transfer_btn = False + has_visible_transfer_btn = True # 判断按钮隐藏条件 如果没有可用的就跳过(说明流程最后一步) if not transfer_buttons: has_visible_transfer_btn = True else: for btn in transfer_buttons: - if not btn.invisible_expression: - has_visible_transfer_btn = False - break - else: + if btn.is_review_invisible: domain = eval(btn.invisible_expression) expression_result = self.search(domain) has_self_in_result = self.id in expression_result.ids if not has_self_in_result: has_visible_transfer_btn = False break + else: + has_visible_transfer_btn = True if not has_visible_transfer_btn: skipped_node_names.append(next_node.name) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 3a7cf858c..e6d1ea072 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -154,6 +154,8 @@ class SoongWorkflowCommentWizard(models.TransientModel): for record in self: if not record.trans_link_id: continue + available_links = self.env['trans.link'].search([]) + record.invalid_link_ids = available_links[1:] record_id = self.env[record.res_model].browse(record.res_id) if record.res_model and record.res_id else None for link in record.trans_link_id: employee_user_role_ids = self._get_approvers_for_link(link, record_id) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 6649044ca..c58649264 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -112,10 +112,9 @@ class HrAttendance(models.Model): record.company_id = False def write(self, vals): - # 仅在修改check_out字段时执行逻辑 if 'check_out' in vals: for record in self: - target_date = record.current_data # date类型 + target_date = record.current_data start_of_day = datetime.combine(target_date, datetime.min.time()) end_of_day = start_of_day + timedelta(days=1) start_str = fields.Datetime.to_string(start_of_day) @@ -127,7 +126,6 @@ class HrAttendance(models.Model): ]) if detail_records: - # 提取所有checkin_time并找出最大值 max_checkin_time = max(detail_records.mapped('checkin_time')) vals['check_out'] = max_checkin_time return super(HrAttendance, self).write(vals) From a09210f958fe45cf62c2a33b2fb5b217b1d9aabe Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 13 Aug 2025 19:43:35 +0800 Subject: [PATCH 21/21] =?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 --- soong_workflow/models/soong_workflow_mixin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 6f49befb4..18c9d7d4d 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -350,9 +350,11 @@ class SoongWorkflowMixin(models.AbstractModel): domain = eval(btn.invisible_expression) expression_result = self.search(domain) has_self_in_result = self.id in expression_result.ids - if not has_self_in_result: - has_visible_transfer_btn = False + if has_self_in_result: + has_visible_transfer_btn = True break + else: + has_visible_transfer_btn = False else: has_visible_transfer_btn = True