diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index ec637b159..18c9d7d4d 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -340,18 +340,28 @@ class SoongWorkflowMixin(models.AbstractModel): btn for btn in next_node.button_ids if btn.name == '转交' ] - # 判断按钮隐藏条件 如果没有可用的就跳过 + has_visible_transfer_btn = True + # 判断按钮隐藏条件 如果没有可用的就跳过(说明流程最后一步) 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 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 has_self_in_result: + has_visible_transfer_btn = True + break + else: + has_visible_transfer_btn = False + else: + has_visible_transfer_btn = True + 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/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/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 460f5ee79..7d8b436e0 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -121,7 +121,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: @@ -301,7 +301,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': '打卡成功'} diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 6eee1e0bf..c58649264 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -111,6 +111,25 @@ class HrAttendance(models.Model): else: record.company_id = False + def write(self, vals): + if 'check_out' in vals: + for record in self: + 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) + 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', '>=', start_str), + ('checkin_time', '<', end_str) + ]) + + if detail_records: + 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) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 916eb03b1..f0149f2e0 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 not existing_checkout or new_checkout > existing_checkout: - attendance.check_out = record.checkin_time + attendance.check_out = record.checkin_time # 传参按一个人打卡一次传参 diff --git a/yuthon_official/__manifest__.py b/yuthon_official/__manifest__.py index 58f28df2e..ee81c1654 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', @@ -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', diff --git a/yuthon_official/views/official_menus.xml b/yuthon_official/views/official_menus.xml index a368a9d79..7cbfa5bed 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_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/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..4e922749a 100644 --- a/yuthon_property_approval/views/property_eligibility.xml +++ b/yuthon_property_approval/views/property_eligibility.xml @@ -42,17 +42,15 @@ + + + - - - - - 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 @@ + + + - - - - - 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 @@ + 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 @@ - - - - - - - - - - - - - - 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"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + sequence="1"/> - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +